Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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





0 votes

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;

}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,529 views 22 32
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you