query and report when using tickets that are linked to other tickets

ribas March 14, 2024

in our workflow we have defined tickets with type "PR" and tickets with type "IMPACT"

PR tickets are always linked to "IMPACT" tickets.

 

Is there a way to make a search of CR tickets like this :

 

"display CR ticket that are linked to IMPACT ticket which attribute XXXX of the IMPACT is equal to YYYYY" ?

 

And also, is there a way to have a report of the list of CR tickets with columns that displays attributes of the linked IMPACT tickets ?

 

thanks a lot

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2024

Hello @ribas 

Neither of those requirements can be satisfied by native Jira functionality.

Are you willing to purchase a third party plugin in order to fulfill your need?

ribas March 14, 2024

thanks for your answer. I don't know yet, I'm quite surprised that it couldn't be done. are we the only one to have such combination of ticket ?

like, one ticket to describe the problem and then several impact to correct it (documentation, source code editing, verification document to update, etc.)

 

isn't there already a plugin to do this ?

ribas March 14, 2024

or maybe using a dedicated JQL command in the "advanced" search menu ?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2024

If you are using the generic issue linking function there is a generic function called linkedIssues(<issue key>,<link type>) that enables you to get all the issues linked to <issue key> and optionally restrict that to the <link type> used. However you must explicitly provide the <issue key> (in your case the IMPACT issue). 

The function doesn't support providing multiple issue keys. 

You can find that and other native functions described here:

https://confluence.atlassian.com/jirasoftwareserver/advanced-searching-939938733.html

 

What you need is something like this:

issue in linkedIssues("project=IMPACT and XXX=YYY")

...where you can provide a filter to select the primary issues (the IMPACT issues) and then get the linked issues for all the issues that are returned by the filter.

Jira does not natively support that, but there are third party plugins that do.

 

Adaptavist ScriptRunner is one that I've used. There are others. Here is a search from the Atlassian Marketplace that lists plugins that extended the capabilities of the search function:

https://marketplace.atlassian.com/search?hosting=dataCenter&product=jira&query=jql

ribas March 15, 2024

thanks a lot, we have scriptrunner. do you have an example of the function that could be user to make such a query ?

ribas March 15, 2024

by the way, Maybe my initial question was wrong, I am not playing with linked ticket but I'm using task and subtask. 

CR tickets have sub-ticket that have "impact" type. I don't know if it change the answer.

@Trudy Claspill 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2024

Hello @ribas 

The fact that you are working with tasks and subtasks changes the function you would use, but otherwise the necessary functionality is the same. It also makes a difference that IMPACT is an issue type, not a project.

To get the Task issues that have subtasks that meet specific conditions you would use the function parentsOf()

https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-enhanced-search/jql-functions#parentsof

issuetype=Task and issuefunction in parentsOf("issuetype=Impact and XXXX=YYYY")

ribas March 15, 2024

thanks a lot it works great. I don't succeed to use a "childsOf". does it exists?

like this :

issuetype="Impact" and issuefunction in childsOf("issuetype="Change Request"")

 

I don't see anything to perform a query about subtasks of "top" tasks...

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2024

Hello ribas,

"childsOf" is not a valid function. Please review the information in the document link I provided.

Please explain your full issue hierarchy structure.

Please tell us at what level are the issues that you want in your results.

Please tell us at what level you are trying to apply your criteria to get those results.

 

ribas March 18, 2024

thanks I read the documentation and I saw the childrenOf function. but I can't get it working.

For instance:

issueFunction in childrenOf("issuetype = "Change Request" AND Domain = PLD_FRAMEWORK")

=>

Error in the JQL Query: Expecting ')' or ',' but got 'Change'. (line 1, character 43)

 

by the way :

issuetype = "Change Request" AND Domain = PLD_FRAMEWORK

=> works great

 

hierarchie structure is the following :

one project that contain issues called "Change Request".

each "Change Request" has one or several subtask called "Impact"

 

I can use  :

issuetype="Change Request" and issuefunction in parentsOf("issuetype=Impact AND component=COCKPIT")

to look for "Change Request" that are parent of specific Impact. But I can't do the opposite (look for impact that are children of specific "Change Request")

ribas March 18, 2024

for your information, "change request" = issue and "Impact" = issue also but a sub-task of "change request"

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2024

I believe this

issueFunction in childrenOf("issuetype = "Change Request" AND Domain = PLD_FRAMEWORK")

...did not work because of your use of quote marks.

Change it to use single quote marks around Change Request.

issueFunction in childrenOf("issuetype = 'Change Request' AND Domain = PLD_FRAMEWORK")

You need to surround the whole filter within the parentheses with double quote marks. Anything within the filter that needs to also have quote marks needs to use single quote marks. Otherwise it cannot be parsed correctly.

ribas March 19, 2024

thanks, it is better now but still not working :-(

issueFunction in childrenOf("issuetype = 'Change Request' AND Domain = PLD_FRAMEWORK")

=> 

Unable to find JQL function 'childrenOf(issuetype = 'Change Request' AND Domain = PLD_FRAMEWORK)'.

 

Is it possible that 'childrenOf' is disabled on my side ???

ribas March 26, 2024

are we missing something ? is it normal that childrenOf seems to be unsupported on our side ? maybe our scriptrunner extension is incomplete ?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2024

I apologize. I was referencing the documentation for the Cloud version of ScriptRunner, and I see from your post tags that you are using Jira Data Center.

To retrieve Sub-tasks based on a filter for their parent issue you need to use the subtasksOf() function for ScriptRunner for Jira Data Center.

https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/sub-tasks

ribas March 26, 2024

thanks a lot, it works great !

 

it is strange such a difference between the server and the cloud version. it will be merged "one day" ?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2024

I'm glad I was able to help.

Please consider clicking on the Accept Answer button. That will mark your question as Solved and help others searching the community for answers find the posts with validated solutions.

 

It is unlikely that the Data Center and Cloud versions of ScriptRunner will eventually "merge". In the Server/Data Center environment app vendors can access the database and files of the Jira application directly, which enables them to create a wider variety of features. In the Cloud environment they do not have that level of access. Instead they can interact with Jira only through Atlassian approved APIs and integration points. That greatly restricts what they can do, compared to the Server/Data Center environment.

Atlassian has also made changes in Jira Cloud that are not being reproduced in Jira Data Center. Some data is deprecated while other data is added, and new functionality may be added while while other functionality is deprecated. This also affects what vendors are able to provide in their apps.

I understand app vendors are working diligently to reproduce as much functionality as they can, but for many a 1 to 1 feature parity may never be possible.

Suggest an answer

Log in or Sign up to answer