I have an automation task which triggers when Jira task updated. It is supposed to take the id from a User Picker (single user) field and assign all subtasks to that user.
This is done through Additional Fields code
{"fields": {"assignee": { "id": "{{Staff Member Jira Profile.accountId}}"}}}
But Audit Log says
Action details:
Multiple issue eventsRule was triggered by event:Issue UpdatedLog actionLog"assignee": { "id": "5b4c99065f430b2c1c4efb45"} Log actionLog5b4c99065f430b2c1c4efb45Issue conditionThe following issues passed:IBT-86
Edit issue
Error editing issues
IBT-91 (Specify a valid value for assignee (assignee)), IBT-92 (Specify a valid value for assignee (assignee)), IBT-90 (Specify a valid value for assignee (assignee)), IBT-88 (Specify a valid value for assignee (assignee)), IBT-93 (Specify a valid value for assignee (assignee)), IBT-87 (Specify a valid value for assignee (assignee)), IBT-89 (Specify a valid value for assignee (assignee))
"assignee": { "id": "{{Staff Member Jira Profile.accountId}}"}
{"fields": {"assignee": { "id": "5b4c99065f430b2c1c4efb45"}}}
Hi @Andrew Syme
I wonder if there is some type of context issue and the current issue is not the one you think it is, perhaps leading to NULL in the field. Would you please post an image of your complete rule? That may provide some context for what is happening. Thanks!
Kind regards,Bill
Hi @Andrew Syme - Have you tried {{Staff Member Jira Profile}} (no ID call out... User pickers should be storing the id by default)?
If that doesn't work, sometimes I've found simply referencing the custom field ID rather than the label works better for me (also allows for changes to the field name without having to revisit automation rules):
{{customfield_xxxxx}}
All 3 versions of code
{{customfield_1047X}}{{Staff Member Jira Profile.accountId}}{{Staff Member Jira Profile}}
produce the same user ID 5b4c99065f430b2c1c4efb4X
but
{"fields": {"assignee": { "id": "{{customfield_1047X}}"}}}
still fails with error "(Specify a valid value for assignee (assignee))"
If I try
{"fields": {"assignee": { "id": "5b4c99065f430b2c1c4efb4X"}}}
it works.
But I want to assign to a different user depending on the field so I can't hard code.
It's as if the ID returned is not text or something similar?? I'm lost
Rule
Audit
Thanks for interest Bill
Yup, context appears to be the issue.
If you want the values from the trigger issue to be copied to the subtasks, use that info in the edit action. Otherwise when you do not specify the issue, it assumes "current issue" would would be the currently used subtask in the branch looping
So in the edit, please try:
{{triggerIssue.description}} for the simple edit, and
{{triggerIssue.customfield_10478}} in the advanced edit with JSON
And also...rather than using advanced edit with JSON, have you tried to just edit the Assignee field (from the dropdown list), and type in the trigger issue's smart value? It will appear below the field and then you may select it for use.
Thanks Bill
{{triggerIssue.customfield_10478}} in the advanced edit with JSON works.
However using dropdown option
Sets the sub-task assignee to unassigned.
From memory this was an issue I found before hence why I went to advanced edit.
It looks like you're new here. Sign in or register to get started.