Using a variable to set Assignee in Jira Automation fails with 'Specify a valid value for assignee'

Kawa Akbulut
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2025

 

 

Hi everyone,

I'm running into a puzzling issue with Jira Cloud automation. I want to set the assignee using a variable that contains the Atlassian account ID. If I hardcode the exact same account ID in my Advanced JSON—like this:

{ "fields": { "assignee": { "id": "5b10ac8d82e05b22cc7d4ef5" } } }

 

—it works perfectly, and the assignee is set without problems.


However, if I store that very same account ID in a variable (e.g., {{myUserId}}), and then reference it like:


{ "fields": { "assignee": { "id": "{{myUserId}}" } } }

 

--the rule fails with the error “Specify a valid value for assignee (assignee)”.

I’ve checked the following:

  • The variable logs the correct account ID (confirmed via a Log Action).
  • The user is active, has a Jira license, and has the “Assignable User” project permission.
  • I’ve tried adding quotes, using asJsonString, etc.

Nothing seems to fix the error unless I manually hardcode the ID. Has anyone experienced this or know what might be causing the difference when using a variable versus a direct value?

Thanks in advance for any insights!

2 answers

0 votes
Kawan Diogo
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.
January 31, 2025

Hi @Kawa Akbulut 

 

You can also use the Assign issue action in this automation, but perhaps you are using the advanced field edit, you can try something like you did with the asJsonString, the follow value:


{ "fields": { "assignee": { "id": "{{myUserId.trim}}" } } }

 

Best Regards. 

0 votes
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.
January 31, 2025

Hi @Kawa Akbulut -- Welcome to the Atlassian Community!

For a question like this, context is important for the community to help.  Please post the following:

  • what type of project is this (e.g., company-managed, team-managed, etc.), 
  • an image of your complete automation rule in a single image,
  • images of any relevant actions / conditions / branches, and
  • an image of the audit log details showing the rule execution

 

Until we see those...

Have you confirmed your variable does not contain any leading / trailing spaces?

 

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer