Forums

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

Behaviour script in Jira

Sharadkumar Bangera
Contributor
March 20, 2025

Hello

I am using Jira Service Management, and I have a requirement related to a Behaviour script in Jira. My requirement is as follows: When I select the value "None" from the field named "Delay Justification", the Comment field should be empty. When I select any other value from the "Delay Justification" field, the Comment field should automatically display the text "Delay justification Reason please add". I tried below script but it is not working ,all other option when selected , nothing appears in comment field I would appreciate your assistance with achieving this functionality.

import com.atlassian.jira.component.ComponentAccessor

def delayJustificationField = getFieldByName("Delay justification")

def commentField = getFieldByName("Comment") 

def delayJustificationValue = delayJustificationField.getValue()

if (delayJustificationValue == "None")

{ commentField.setFormValue("") 

else if (delayJustificationValue) {

commentField.setFormValue("Delay justification Reason please add") }

2 answers

0 votes
Sharadkumar Bangera
Contributor
March 21, 2025

.

0 votes
Mohamed Benziane
Community Champion
March 20, 2025

Hi,

can you try : if (delayJustificationValue == null)

Sharadkumar Bangera
Contributor
March 21, 2025

its not working , still i see the comment when none is selected

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events