I'm working on trying to set up an automation to have visibility into which ideas in JPD are being worked on in which Sprints. I set up a multi-select field in my JPD project for Sprints, and pre-populated with the available sprint options.
My problem is that I can't seem to figure out the right format to feed the list of sprints (from all linked delivery tickets) to the JPD custom field such that it will read them correctly. I keep on getting an error unless I send back a single value, e.g. the first value in the array / list.
Any help here would be appreciated!
Hi @Mahriah Alf -- Welcome to the Atlassian Community!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
I recommend pausing to explain this scenario / need to your Jira Site Admin. They may have other solution approaches to try, such as with dashboards, etc.
Next, from what you describe, you have hard-coded a set of Sprint names from one-or-more projects into the JPD multiple-select option field. That likely will be a brittle solution to maintain over time. Regardless of that...
To access the work items linked as "Delivery Tickets" to a JPD Idea, the rule scope will need to be multiple-project or global...and your Jira Site Admin will need to help change that.
With the scope changed, a rule could use the Lookup Work Items action to find the Delivery Tickets by their link type and association to the Idea. Then the Sprint field in each item may be parsed to find the correct one. Finally, those results may be iterated to create a JSON expression to update your multiple-selection field:
Kind regards,
Bill
Thanks Bill. I do have the multi-project Admin capabilities and is set up that way. Thanks.
Completely agree on the "brittleness" of the solution. The only reason I'm doing multi-select vs. free text is because I can't filter or group by a free text field for any of my views and I would like that capability. I'm open to other options if there are suggestions!
Here is the configuration of the automation:
This is just for the one-time batch update and testing the automation (I have a separate one that's triggered by any change in the Sprint field in the delivery tickets)
This is the error that I'm getting:
And, yes, I've verified that the field has all of those as options in the multi-select field dropdown (and I've verified that it works if I only pass one value, it's only an issue when I pass multiple)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the additional details, @Mahriah Alf
Earlier I noted the need to parse the Sprint values found, by work item, in the Lookup Work Items results. This is necessary because...
Let's put those two concepts together using the Created Variable action to help:
{{#lookupIssues}}
{{#sprint}}
{{#if(equals(state, "active"))}}~~{{name}}{{/}}
{{/}}
{{/}}
{{varActiveSprintNames.substringAfter("~~").split("~~").trim.distinct.join(", ")}}
distinct active sprint names: {{varDistinctSprintNames}}
{
"fields": {
"customfield_10507": [
{{#varDistinctSprintNames.split(", ")}}
{ "value": "{{.}}" }{{^last}}, {{/}}
{{/}}
]
}
}
Please try adding the additional actions and revise the edit to test the changes.
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.