Forums

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

Behavior script to set assignee based on a custom field

Eya BEN OTHMEN September 24, 2021

Hello community,

i want to create a behavior script to set assignee based on a custom field (in create screen)

i tried this script but it didn't work

could you help me please!

 

import static com.atlassian.jira.issue.IssueFieldConstants.ASSIGNEE
def Motifs = getFieldByName("customfield_30100")
if (Motifs.getValue() == "PAYS à risque LCBFT - Corruption - Sanctions internationales") {
// Set assignee to Dape Conformite Service
getFieldById("assignee").setFormValue("Dape Conformite Service")
}
else if (getFieldById("assignee") == "Dape Conformite Service") {
// Set assignee back to "Automatic", in case user picks Support
getFieldById(ASSIGNEE).setFormValue("Automatique")
}

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer