Hi,
I am looking to figure out how to traverse through a list (in this case, "issuelinks" and:
a) Count the total number of inward links
b) Count the number of inward links that have a status of done
I know how to:
- Count the # of inward links, using:
{{issue.issuelinks.inwardIssue.size}}
- Identify the status of each inward link, using:
{{#issue.issuelinks.inwardIssue.fields.status}}{{name}}{{/}}
- Determine if that status of an inward link is Done using; {{#issue.issuelinks.inwardIssue.fields.status}}{{name.equals(“Done”)}}{{/}}
But, I am unable to figure out how to count the # that are not Done. Ultimately, I want to set counters (custom fields) with following values: Count of Incoming Links that are Open, Count of Incoming Links that are Done and display these in Jira Dashboards.
Any ideas?
Thanks,
Doug
Hi @Doug Levitt
Your conditional expression to find the linked issues with a "Done" status is returning a list of comma-separated values. If you stick that into a created variable, e.g. varDoneList, you could then count them:
{{varDoneList.split(",").size}}
To get the non-done count, just subtract that from your total count.
Kind regards,
Bill
Hi @Bill Sheboy
Thanks. That is very helpful.
As I think about my ultimate solution, I have a more complex question...
Assume, I have the following links:
According to the json structure, each link is associated with a:
So, I am now interested in populating the following custom fields for each jira issue:
TicketsIamDependentOn
TicketsThatDependentOnMe
countOfAllDependentLinks
countOfOpenDependentLinks
I suppose I don't want to simply count the entries in the issuelinks list. Rather, I want to take action based upon other attributes in the json. I am unclear how to specify this. Any ideas or pointers on how to do this?
Thanks,
Doug
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Doug!
I believe what you ask is possible with list functions and the list filtering capability:
https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
With that, you probably can pull out the keys by type into a created variable, and then use that for your dependency list and count. Removing any two-way duplicates (due to multiple linkages types) could be a bit tricky.
I recall previously doing something like this as an experiment with variables, lists, text, and regular expressions. This new feature seems much better.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.