How to place JOIN in Azure DevOps QueryEditor

Azure DevOps provides a feature called Query Editor where you can put your query using simple UI and run this. Simple query can be place/create here very easily. Complex query like join query would be a tricky one.

Here, I tried to simplify how we can design a join query using Query Editor. Let's say I want to see all the bugs which already got closed or resolved by my team. Here, we know which ADO field is what for. For example ADO field AreaPath represents project team.

In SQL term it is like SELECT * FROM MT-DEVOPS-PROJECT-DATA WHERE PROJECT=My-Project AND TYPE='Bug' AND (STATUS = 'Resolved' OR STATUS = 'Closed'  OR STATUS = 'Completed')



In QueryEditor window, you can need to join the QUERY in below terminology

(SELECT * FROM MT-DEVOPS-PROJECT-DATA WHERE PROJECT=My-Project AND TYPE='Bug' AND STATUS = 'Resolved')  OR

(SELECT * FROM MT-DEVOPS-PROJECT-DATA WHERE PROJECT=My-Project AND TYPE='Bug' AND STATUS = 'Closed')  OR

(SELECT * FROM MY-DEVOPS-PROJECT-DATA WHERE PROJECT=My-Project AND TYPE='Bug' AND STATUS = 'Completed')


Now, lets have a look how the same has been implemented in QueryEditor designer. When the new SELECT iteration starts, the OR started and every OR represents a new SELECT JOIN here.


Let's say, you want to select the data not only from your DevOps project data, instead you want your query will fetch data from all the DevOps project in your organization. To do so, just turned on/checked the option Query across projects checkbox on your top right corner of your QueryEditor.


In the above example, the field under the redbox is integration field between ADO and ServiceNow. Using this mapping field, I can place my filter and control my SQL statement. However, please note there are limitation on QueryEditor and hence much complex might not be feasible to implement through here. For much complex report, I'd recommend to use Power BI through reading the data from ADO.

I hope the above notes will help you and if you have any questions, please feel free to post it. Thank you!

Comments

Popular posts from this blog

How to fix Azure DevOps error MSB4126

SharePoint Admin Center

How to create Custom Visuals in Power BI – Initial few Steps