Setting assignee to the value of a custom field

We are evaluating Script Runner for purchase. We would like to have a workflow step that creates a subtask, and assigns the subtask to the value of a custom field (of type user picker) in the parent task ("QA Verifier").

 

Here's the code:

import com.atlassian.jira.user.ApplicationUsers;
def cfQAVerifier = customFieldManager.getCustomFieldObjectByName('QA Verifier');
issue.assignee = ApplicationUsers.from(sourceIssue.getCustomFieldValue(cfQAVerifier));

 

But here's the results:

2016-06-22 17:04:11,185 ERROR [workflow.ScriptWorkflowFunction]: ************************************************************************************* 2016-06-22 17:04:11,185 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: RQ-387, actionId: 311, file: null groovy.lang.MissingMethodException: No signature of method: static com.atlassian.jira.user.ApplicationUsers.from() is applicable for argument types: (com.atlassian.jira.user.DelegatingApplicationUser) values: [minaise1(minaise1)] Possible solutions: from(com.atlassian.crowd.embedded.api.User), from(java.lang.Iterable), from(java.util.Collection), find(), grep(), grep(java.lang.Object) at Script60.run(Script60.groovy:16)

 

What am I doing wrong?

 

Thanks,
John

 

1 answer

1 accepted

0 vote

You are probably on JIRA 7? The last line can be:

issue.assignee = sourceIssue.getCustomFieldValue(cfQAVerifier)

yes, that was the problem. Thanks!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

172 views 0 4
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