Forums

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

How can i set the description of a custom field based on the selected option?

Eya BEN OTHMEN September 23, 2021

hello Community,

How can i set the description of a custom field based on the selected option please?

I have the below inline script:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField

 

def Motifs = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_30100");

def Value = (String) getCustomFieldValue(Motifs);
def String LesConsignes = """Texte html"""

if(Value == ["LCBFT - PPE, LCBFT A, LCBFT B"])

{
Motifs.setDescription(LesConsignes)

}

 

Thank you in advance

Eya

1 answer

0 votes
Mohamed Benziane
Community Champion
September 25, 2021

Do you have an error when you try your code on the console ?

Try some log on the value to see if you get something.

Suggest an answer

Log in or Sign up to answer