Get Number of Linked Issues

Miron Giladi June 21, 2021

Hi,

I'm using IssueType called Requirement in Jira and all my US's are linked to this requirement,
I'm want to get all the related linked issues to this requirements (succeeded) and also get the number of related  issues and present it by any gadget I will found in Jira dashboard in a list view.

Requirement --> US --> Number of US

XXX-123 --> XXX-124 , XXX-125 --> 2

I apricate your help to help me to get the number of those US's

Thanks,
Elran

4 answers

2 votes
Priyadharshini CS
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 16, 2021

Hi @Miron Giladi Check if the solution below works for you

  1. Create a custom field named "count" of type Number from Jira settings -> Issues -> Custom fields -> Create custom field . Associate it with the screen of the project where you want to retrieve the information.
  2. Go to project settings -> Automation -> Create rule

    Automation rule details : 

 

Trigger Scheduled 
New Branch Branch/Related issues
Type of related issues : JQL 
JQL : use the JQL query as per your requirement

Action

Lookup issues 

Action Edit issues -> choose the field that we created in Step 1  "count"

Use the smart value as below
{{lookupIssues.size}}

  1. Publish the rule
  2. Once published, click on "Run rule". 
  3. The rule will run and then the count field will be filled with the values calculated with the automation rule.
  4. Now, create a filter with the JQL as below : 
project = projectname AND "count[Number]" is not EMPTY
  1. Save the filter
  2. Now go to the "Dashboard" and choose "two dimensional filter gadget" -> choose the filter we created in step 5. 
  3. Choose the two fields Key and count
     *  *
  4. Click on Save
  5. The result will be as shown in the image below :
        
Martin Cleaver
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.
May 9, 2022

All images are broken:

Snag_2653ea96.png

Like Kadhem MEJRI likes this
Martin Cleaver
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.
May 9, 2022
Kadhem MEJRI August 3, 2023

Hello,

Could you please re-upload the images ? they are not available anymore

thank you

0 votes
Daniel Ebers
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.
June 26, 2021

Hi @Miron Giladi

if I understand you correctly the requirements and the other issues are perfectly linked and you already have a JQL query in place to find out what you need. However, you want to have a count (represented by a custom field?) in your issues that shows how many issues are linked to a specific requirement, represented in your example as XXX-111 - please confirm if this is correct.

If so ... and you have a scripting App in place you can use it likely to reach the goal.

In this example (here it is ScriptRunner) it comes quite close to your requirement I believe, worth having a look at:
https://library.adaptavist.com/entity/number-of-linked-alerts-itsm

For displaying on dashboards it will be a different thing, usually Gadgets do not offer number fields as a source for visualizing data. This part would likely need more inspection.

So far - is it what you are looking for? Please feel free to update us here if you find the time.

Regards,
Daniel

0 votes
Miron Giladi June 22, 2021

Hi Vikrant,

Thanks for your replay.
to get all the linked issues, I already succeeded.

My problem is bigger than get all the issues and I will try to explain shortly.

I need to present all related issues to many requirements, for example in fix version X I have 40 requirements, so I want to see a list of those requirements with number of related issues to each requirement.

requirement 
requirement XXX-111 --> 11 related issues
requirement XXX-222 --> 12 related issues
requirement XXX-333 --> 13 related issues
requirement XXX-444 --> 14 related issues

If you have any suggestion, I will be happy to hear :)

0 votes
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2021

Hi @Miron Giladi Try below query to get all linked issue of an issue :-

issue in linkedIssues("issuekey") . it gives the number of issues linked to a particular issue. 

issue in linkedIssuesInFilter("10000")

https://www.j-tricks.com/jqlt-links-functions.html#:~:text=issue%20in%20linkedIssues(%22TST%2D,will%20get%20the%20same%20result.

If you have a script runner plugin installed , you can get better result based on issue type :- 

For eg :- issueFunction in linkedIssuesOf("project=xyz", Blocks)

https://valiantys.com/en/blog/atlassian-administration/jql/

 

 

Thanks

VY

Suggest an answer

Log in or Sign up to answer