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

Dave Gibbons February 7, 2017

{
"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

0 votes
Dave Gibbons February 8, 2017

I'm using Automation for JIRA by code barrel.

Max Andersen September 25, 2017

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

Thank you!

0 votes
Dave Gibbons February 8, 2017

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

0 votes
Randy
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.
February 7, 2017

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

 

 

0 votes
Jon Bevan [Adaptavist]
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.
February 7, 2017

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

Suggest an answer

Log in or Sign up to answer