Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×When create issue screen populated, Assignee contains "Automatic". Instead it should be populate the current user or the reporter (both are same).
I am using script runner.
I tried with behaviours; could not get thru.
Anyone can help?
Hello,
Try to use a code like this:
import com.atlassian.jira.component.ComponentAccessor import com.onresolve.jira.groovy.user.FieldBehaviours import static com.atlassian.jira.issue.IssueFieldConstants.* import groovy.transform.BaseScript def assignee = getFieldById(ASSIGNEE)
def reporter = getFieldById(REPORTER) assignee.setFormValue(reporter.getValue())
Thanks Alexey! It works like a charm.
I written only last 3 lines. and did not have a clue, which object is available in which package (to import)..
Any idea, where i can start learning on these? any knowledge base links.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can find more info here:
https://scriptrunner.adaptavist.com/5.4.12/jira/behaviours-overview.html
If you have any questions, just ask :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Can anyone suggest more recent code version, Scriptrunner throws errors when i try to use code versions above
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am running this as a post-function via ScriptRunner but it is not setting the assignee for some reason:
if(issue.assignee == null){
issue.setAssignee(issue.reporter)
log.info("post assignee " + issue.assignee)
}
My log output comes back with 'post assignee THE RIGHT VALUE', but it is not reflected in Jira when I open the issue.
This seems so simple but not working, any help would be greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Currently am using below script:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import static com.atlassian.jira.issue.IssueFieldConstants.*
import groovy.transform.BaseScript
def assignee = getFieldById(ASSIGNEE)
def reporter = getFieldById(REPORTER)
if( assignee.getValue() == "-1" || assignee.getValue() == "")
{
assignee.setFormValue(reporter.getValue())
}
But it does not work for sub-sequent launches. if i cancel the "create issue" screen and re-launch it then assignee shows as "automatic" only.
It works only if i complete the issue creation successfully.
Any idea, how to enforce this to work every time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.