how to set assignee as reporter only if assignee left as blank?

muhannad Almunyif June 30, 2019

how to set assignee as reporter only if assignee left as blank? as we need to make any logged user needs to create an issue to make him as assignee if assignee left blank or as automatic assignee.

2 answers

0 votes
Alexey Matveev
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.
July 1, 2019

Hello,

You would need an app for it like Power Scripts, ScriptRunner, Automation for Jira and so on.

@PVS  gave an example with ScriptRunner or any app, that supports groovy.

If you want to use the Power Scripts app, then you could create a post function with a code like this:

if (isNull(assignee)) {

   assignee = reporter;

}
0 votes
PVS
Banned
June 30, 2019

Hi  @muhannad Almunyif 

Try to use a code like this:

 

You can find more info here:

https://scriptrunner.adaptavist.com/5.4.12/jira/behaviours-overview.html

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())





Suggest an answer

Log in or Sign up to answer