Using the Script Post - Function in Workflow Transitions

Hi,
I've created a post function for a workflow transition using the Script Post-Function option > Clones an issue and links.

The purpose for this is to re-create the issue and it's details into a different project.

This all works fine, however, I'm having trouble trying to change the assignee value of the cloned issue; there is a field in the "Clones an issue and links" option called "Additional issue actions" where you can hard code specific field values. I've entered the following in an attempt to change the assignee:

  • "IssueInputParameters.setAssigneeID('username') "

After publishing the workflow with the above config, and testing the change - the issue fails to clone. Taking out the value in "Additional issue actions" brings back the functionality to clone after the workflow transition is processed.

Can you please advise what the code is to enter in the "Additional issue actions" - or is it even possible to do such a config?

Current JIRA version is: 5.1.5

Cheers,
Fletch

2 answers

1 accepted

This widget could not be displayed.

Solved! The syntax I used and can confirm working is:

issue.assigneeId = "username"

Entering this in the Additional Issue Actions will set the Assignee to what is specified rather than take the Assignee from the issue being cloned.

This widget could not be displayed.

OK, I did some further testing and was able to change the Summary value for the cloned issue by typing the following in Additional Issue Actions:

issue.summary = 'new summary name'

I found after reading https://jamieechlin.atlassian.net/browse/GRV-336 that the set option for changing the summary, or the other set options do not work.

Just wondering what the correct syntax is for changing the assignee? I've tried:

- issue.assignee = 'username'

- issue.assigneeid = 'username'

Both have failed after the workflow transition..

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

269 views 5 0
Join discussion

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