Forums

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

How to get Current Status using Serverscript from Behaviours-plugin

Kris Han
Contributor
May 28, 2018

Hi everyone,

I am a new and I have a question which need to ask that is how to get current issues Status using serverside script on behaviours-plugin? such as If current-status is "Open" then customfield  will be hidden and required. If someone who can provide full script and description will be better, because I am a new so I have more detail for me to be a expert. Thank you very much!

1 answer

1 accepted

0 votes
Answer accepted
Praveen
Contributor
May 28, 2018

Hi,

Please use the below code for the above requirement, 

def status= underlyingIssue.getStatus().getName()
def field = getFieldByName("*custom field name here*") if(status.toString().equals("Open")){ field.setRequired(true) }

 -Praveen

Kris Han
Contributor
May 28, 2018

Hi, 

Thank you very much! It looks useful now.

 

Praveen
Contributor
May 28, 2018

Hi,

Thanks for the confirmation! You can mark the answer as accepted so that others will be able to find if useful too.

-Praveen

Suggest an answer

Log in or Sign up to answer