Hi everyone,
I’m working on a Jira Automation rule and ran into a limitation when trying to link multiple issues dynamically via an Advanced Edit action.
Here’s the context:
Inward Table: LookupTable{objectMap={96008=PSS-10173, 95276=COR-53017, 95271=PSS-10040}, size=3, entries=[LookupTableEntry{key=96008, value=PSS-10173}, LookupTableEntry{key=95276, value=COR-53017}, LookupTableEntry{key=95271, value=PSS-10040}]}
Then I have a smart variable called
{{PSSInwardIssueKeys}} = PSS-10173, PSS-10040
(it’s generated earlier in the rule based on the lookup table and can contain one or several PSS issue keys).
I’m already inside a branch that loops over the most recently created work item.
Now I want to link this most recently created work to multiple PSS issues.
Here’s the Advanced Edit I’m using:
{
"update": {
"issuelinks": [
{
"add": {
"type": {
"name": "Fixes in continuous deployment"
},
"outwardIssue": {
"key": "{{PSSInwardIssueKeys}}"
}
}
}
]
}
}
As expected, this works fine if there’s only one issue key in the variable.
But when multiple keys are included, Jira returns this error:
Error editing work items
COR-53314 (Too many operations (2) provided for field 'issuelinks'. We support at most 1 operation for this field. (issuelinks))I understand why this happens — the REST API expects one add object per link, not a comma-separated list — but I can’t easily add another For each smart value branch to loop over {{PSSInwardIssueKeys.split(",")}}, since I’m already inside a branch for the Hotfix.
So, is there a way to:
Dynamically generate multiple "add" blocks in one Advanced Edit JSON (e.g. using smart value iteration within the "most recently created work item" branch)?
Or otherwise, link multiple issues within a single branch context?
Any ideas or examples would be much appreciated, ideally something that can handle a variable number of linked issues without leaving the current branch.
Thanks!
There are 3 elements where u can iterate though objects. They are different but sometimes can be abused to achieve the goal.
1. Branch
2. Lookup issues (blue action)
3. Scheduled trigger (green trigger)
You can consider rebuilding your mechanism to get "recently created issues" (or list of keys to be linked)) using Scheduled trigger. This way you can run a single action per iterated issue.
Not sure if it will help, but maybe its worth a try.
Hi Mart,
I didn't get into the guts of what you are doing exactly, but below is how I do something similar (linking a work item to multiple other work items) using lookupIssues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @John Funk
Thanks for your suggestion.
As far as I understand, this is not possible in my use case.
Some more details about the automation rule:
Hope that clarifies...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not do what I do and create a second rule that fires when the work item is created in step 1? You don't have to try to do everything in one rule. Just be sure to check the box on the rule details of the new second rule to allow it to be executed as the result of another rule.
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.