Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Transition screen Assignee - default value

Jan Mostowski March 27, 2020

Hi everyone!

I have a question:

I have a Screen on transition with Assignee field and I would like to set a default value as a  issue reporter. How can I do this?

 

TIA

1 answer

0 votes
Jack Brickey
Community Champion
March 27, 2020

You can use the Post Function to set the default. Copy from reporter. Will that work?

Jan Mostowski April 1, 2020

I have already done this but I would like to leave the funcionality to assign this during status change - transition screen. But when I have set post-funkcion "copy assignee from reporter" it's impossible to set this during transition because set value is overwriten by post-function :(

Jack Brickey
Community Champion
April 1, 2020

Thanks for clarifying your requirements Jan. So you want a conditional assignee - ‘if assignee is empty then use default’. For this you will want to use some form of automation. Do you have any such addon, e.g. Scriptrunner, Power Scripts, Automation for Jira, etc?

alternatively you can require the assignee be set during the creation.

Jan Mostowski April 1, 2020

Sure I have a Scriptrunner :) So should I paste a script like this in post function for this transition?

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 (issue.fields.assignee == null {
assignee.setFormValue(reporter.getValue())
}
Jan Mostowski April 1, 2020

Sure I have a Scriptrunner :)

So should I put a script into transition postfunction?

Suggest an answer

Log in or Sign up to answer