I have a post function CloneIssue.groovy that kicks off when a certain value is present. This creates a ticket in a different project. What I need to do is make the assignee in the new ticket the reporter.
For the 'Additional issue actions', I put
issue.assigneeId = issue.reporterId
this does not work as it makes the assignee Unassigned.
I verified that the reported is there. I've made the assignee a cfValue field before, but the reporter is NOT a custom field.
Setting the reporter works a bit different than setting the custom fields, therefore you might be unsuccessful in your efforts. Can you try to set the reporter with the following line in the "Additional issue actions" textbox:
To get a better insight, this script is using the InputParameters for creating a new issue, which has some basic JavaDoc here: https://docs.atlassian.com/jira/6.2.3/com/atlassian/jira/issue/IssueInputParameters.html#setReporterId(java.lang.String)
if I understand you correctly, you want to clone ticket A to ticket B and set the assignee of ticket B to the reporter of ticket A?
You can get the value of the current reporter, i.e. the reporter of ticket A by using:
(The question mark will protect you against a NullPointerException)
To set the assignee in ticket B, you can make use of the issueInputParameters:
So if you want to set the assignee of ticket B to the reporter of ticket A, you enter the following line:
Hope this solves your problem!
The transition fails and I get the following in the catalina log
/secure/CommentAssignIssue.jspa [onresolve.jira.groovy.GroovyFunctionPlugin] Error executing post-function javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: issueInputParameters for class: Script9
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Confluence Data Center is a deployment option that was designed for performance at scale. In other words, Confluence will handle increased traffic much reliably in a clustered environment and yo...
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!
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