Script Runner Create subtask set assignee in additional code

William McGuinness May 28, 2014

Hi everyone,

I'm using the standard script workflow functions to create a subtask. I want to set an assignee for the subtask. I have used both suggestions here https://answers.atlassian.com/questions/260649/create-subtask-with-scriptrunner-setting-assignee(issue.assigneeId = "username") and here https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Fast-tracktransitionanissue(issue.setAssigneeId('spodyacheva')) for setting the assignee in this field, but neither of them seems to be working.

We had previously implemented the setAssigneeId action, which had worked, but it seems to have broken after an upgrade from 5.1 to 6.2. I didn't read anything about anything like this changing in the release notes, but could I have missed someting? Do I need to go back and change all these post-functions? What do I need to change them to?

Thanks in advance for the help!

3 answers

1 accepted

1 vote
Answer accepted
Tsol
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.
May 29, 2014

Hi,

use the following in additional actions

issue.assigneeId = "username"

Hope that helps

William McGuinness May 29, 2014

Thanks for the suggestion. Unfortunately, that doesn't work either. :(

William McGuinness May 29, 2014

If I add that to the additional actions section, the issue is created as unassigned.

Tsol
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.
June 1, 2014

What's your JIRA and plugin version?

I use the JIRA 6.2.0 and scriptrunner 2.1.17 and works fine.

William McGuinness June 2, 2014

I wish it were something like having an old version. Commented, Jamie, on your post above just a moment ago. My apologies again for wasting everyone's time. In any case, thanks for providing the most recent code.

JamieA
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.
June 2, 2014

Yeah, me too. I suspect the OP has an old version of something.

JamieA
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.
June 2, 2014

No problem. Thanks for fessing up!

Mike Seal October 12, 2014

issue.setAssigneeId("username") worked for me.

0 votes
William McGuinness June 2, 2014

I'm embarrassed to admit it, but it's my mistake on this one. The wrong workflow was assigned, and this workflow had an "assign issue" postfunction on issue creation. Sure enough, works like a charm now that the correct workflow is assigned. There must have been some sort of interactions going on there that caused the issue to come up as unassigned in the end. Thanks for your time, and sorry to be a bother!

0 votes
JamieA
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.
May 30, 2014

Is this 6.2(.0), and which version of script runner?

Suggest an answer

Log in or Sign up to answer