Advanced Searching

Sven Erdtmann September 25, 2019

Hi everybody!

Our company is using JIRA Server (on premise; 7.13) and we have a tricky request from a stakeholder.

We track risks in our projects and have a dedicated issuetype for it. As all devisions are using the JIRA as project management tool, we have also a project head in each JIRA project, where the devision is selected in a drop down list.

The request from a stakeholder is, that he want's to have a list of all risks, which belong to his devision.

I tried many things, but couldn't find a solution on that.

This query from my point of view needs a "where" statement, which is not available.

 

Show all "issuetype = risk" where "issuetype = projecthead AND division = abc"

 

Any ideas, how to accomplish this?

 

Kind regards

Sven

3 answers

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2019

@Sven Erdtmann, if you use the project lead in your project settings to set it to your project head you could use project in projectsLeadByUser() in your query to get all the projects, like this:

project in projectsLeadByUser() AND issuetype = risk AND division = abc
Sven Erdtmann September 25, 2019

@Mikael Sandberg 

ok, I messed the understanding.

We have a issuetype which is named projecthead. It is not a person. In this head there are some project general informations, like the division. From my view it is not possible to use name fields in any case.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2019

Okay, in that case I would say it would be hard to get that data out. Jira natively do not support nested queries, but I don't think even with an app that support it you could get it. Maybe take a look at scriptrunner since it has some powerful JQL functions, or maybe Power Scripts.

Sven Erdtmann September 25, 2019

@Mikael Sandberg 

We have Scriptrunner, but I couldn't identify a useful jql function. :(

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2019

Okay, and are multiple divisions using the same project? If that is the case then yes, I would agree with you that it is not possible to get that list unless there is a link between the projecthead and risks.

Sven Erdtmann September 25, 2019

All divisions use the same template. Each project has his own project in JIRA.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2019

The only thing that may be a solution for this is to use the REST API to get the list, you would then query on the division first to get the project and then from there create the list. Or if each project correspond to just one division you could also use project category and then use that in your query to get the risks, like category = division1 AND issuetype = risk.

0 votes
Sven Erdtmann September 25, 2019

...

0 votes
Cody Stevens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2019

Hey @Sven Erdtmann 

If I am understanding correctly, risks are tracked in your system via their own issue type and the divisions are selected via their own custom field dropdown.

If thats correct, then all you need to do is the below query.

issuetype=risk AND division = "division 1"

I didnt include the project head because from what you said, it doesnt seem like you need to filter off of it. If you do, I am assuming its a user picker? If it is, you would just add

projecthead="user"  
Sven Erdtmann September 25, 2019

Hey @Cody Stevens 

thank you for your reply.

Seems not to work, since the division field is only available in the issuetype "projecthead" not in the risk issuetype.

Filtering on user, would only be useful, as sometimes users are lent to other divisons for a project lead.

 

P.S.: Sorry for miss-using the reply...

Sven Erdtmann September 25, 2019

From my point of view we need to identify all projects where in the projecthead his division is selected and return all risks from these projects.

Suggest an answer

Log in or Sign up to answer