Hi All
I am wanting to do a simple field edit on every work item at every level of the hierarchy below a number of parent issues in one automation.
With the JQL:
(parent IN portfolioChildIssuesOf("ABC-123")
This brings up all issues in the hierarchy below ABC-123, which is great! The main limitation of this is you can only run the query with one issue key at a time.
In our setup, we have a small number of parent issues that I would like to run this automation on. Based on advice and info from other posts, I was able to use
(parent IN portfolioChildIssuesOf("{{lookupIssues}}")
and this give the correct result, but because there were two issues, the automation ultimately failed because this won't work due to two issue keys:
(parent IN portfolioChildIssuesOf("ABC-123, ABC-124")
So ultimately I need to it to loop through the issues keys so it will update all child issues under ABC-123 and all child issues under ABC-124.
Based on a few examples, I built this so far but it does not work:
The advanced branching rule is
Can anyone give me some direction on the right path to get the outcome I'm after?
Also what should the JQL on the scheduler be set to given this automation will be updating many work types in many projects in jira?
Thanks
Hello @Matt_Rochman
Welcome to the Atlassian community.
Are you using a JQL in your trigger?
What I would try is adding a JQL to the trigger to select the issues that you would use as the input for the portfoliochildrenof() function.
Then in the lookupIssues() action plug in your portfoliochildrenof() JQL statement with {{issue.key}} as the parameter.
Then set your branch to iterate over the results of the lookup.
The rule actions will be run for each issue returned by the trigger JQL. So the lookup will run for each of those issues. And the branching will be run for the results of each lookup.
I'm not where I can test this, but theoretically it should work.
Yes I have a JQL in my schedule trigger which is the same as the lookup, which is simply:
worktype = "Non-Portfolio Customer Value"
there's only two work items there at the moment
The JQL I use on the branch is
When I look at audit log, it does show success but when it gets to the JQL condition step, it says:
The following work items did not match the condition:
ABC-123, ABC-124
The work item didn't match the specified JQL.
The chosen rule actor doesn't have permissions (or work item security level permissions) to view the work item.
the work item was deleted or wasn't indexed by Jira yet (in rare circumstances)
We recommend using the 'Issue fields condition' for more consistent results.
Let me know thoughts if you can.
Also you said "Then set your branch to iterate over the results of the lookup." can you let me know how / where this is done on the branch?
Thanks again, appreciated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if you just use {{currentIssue}} instead of {{currentIssue.key}}, as you varialbe name is currentIssue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Matt_Rochman
Let me parrot this back and see if I have it correct.
In the scheduled trigger you are running a JQL that returns a set of issues; let's say ABC-123 and ABC-456.
In the rule you want to update all the child issues under those two, regardless of hierarchy level. You could get the child issues for each of them manually using the filter:
issue in portfolioChildIssuesOf("ABC-123")
issue in portfolioChildIssuesOf("ABC-456")
If I have understood that correctly, then you can accomplish that with a very simple rule:
The JQL in the schedule selects the "parent" issues.
The remainder of the rule will be run for each issue selected by the Schedule trigger.
So, add a For Each: Related Issues: JQL
Insert the JQL that will select all the child issues of a given issue, which according to the documentation is:
workitemkey in portfolioChildworkitemsOf("work item key")
For this case the actual JQL is:
workitemkey in portfolioChildIssuesOf("{{issue.key}}")
That will get all the child items for the issues from the trigger, one trigger-issue at a time.
The remainder of the branch will be executed for each of those issues. So add an Edit action inside the branh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Trudy Claspill
Legend! I think I mysteriously went down a long rabbit hole when the solution was far simpler than I thought. Excellenty! Really appreciated.
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.