Setting the Assignee of a sub task based on a user (custom field) set on the issue.

{
"fields": {
"assignee": { "name": "{{issue.parent.fields.Marketing Manager.key}}" }
}
}

Hey chaps,

 

Having trouble getting this working!  help help help.

 

I've tried using a comment to debug my json.

 

 

Marketing Managerv1.01:
{{issue.parent.fields.Marketing Manager.displayName}}

Key:
{{issue.parent.fields.Marketing Manager.key}}

 

 

which returns:

 

 

Marketing Managerv1.01: 
Bevan Miller [Administrator]

Key: 
admin

 

****Update****
It looks to be a problem with the Assignee field setter  because if I simply do;

  • Manual Trigger
  • For all sub tasks
  • Edit Field - set assignee and choose someone from the drop down
  • Comment to ensure it runs 

 

and the comments are updating proving it's got there, however the assignee does not change

 

4 answers

Dave, are you using a ScriptRunner post function or event listener here?

You're getting values printed with your debug code so that proves that the source values are there and correct.  I'd look into the setter.  Is assignee settable via the method you're trying?  Try hard coding assignee value and see if it throws any errors. 

 

Maybe use this instead: PUT /rest/api/2/issue/{issueIdOrKey}/assignee

 

 

No.  Is that something you'd recommend?  How do I implement that?

I'm using Automation for JIRA by code barrel.

@Dave Gibbons- Did you ever manage to solve this? Your solution is much appreciated.

Thank you!

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

857 views 5 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot