Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Jira Automation assignees

Andrew Syme
Contributor
March 31, 2022

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 events
Rule was triggered by event:
Issue Updated
Log action
Log
"assignee": { "id": "5b4c99065f430b2c1c4efb45"}  
Log action
Log
5b4c99065f430b2c1c4efb45
Issue condition
The 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))
The log is generated with the code
"assignee": { "id": "{{Staff Member Jira Profile.accountId}}"}
If I change the Additional fields code to 
{
"fields": {
"assignee": { "id": "5b4c99065f430b2c1c4efb45"}
}
}
It works fine.
Any ideas why this doesn't work?  Could it be a format issue?

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2022

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

Andrew Syme
Contributor
April 1, 2022

Rule

rule.jpg

Audit

audit.jpg

Thanks for interest Bill

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2022

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.

Andrew Syme
Contributor
April 4, 2022

Thanks Bill

{{triggerIssue.customfield_10478}} in the advanced edit with JSON works.

 

However using dropdown option

Screenshot 2022-04-04 090218.jpg

Sets the sub-task assignee to unassigned.  

From memory this was an issue I found before  hence why I went to advanced edit.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2022

Andrew, if that edit is inside of the branch, then "current issue" refers to the branch issue and not the trigger issue.  For your case you probably need to stick with the JSON edit...sorry I missed that earlier.

0 votes
Mark Segall
Community Champion
March 31, 2022

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}}
Andrew Syme
Contributor
March 31, 2022

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

Suggest an answer

Log in or Sign up to answer