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 edited

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
TAGS
atlassian, jira product discovery, product operations, product ops, linkedin live, atlassian events, cross-functional collaboration, product management, engineering collaboration, design collaboration, atlassian learning, agile teams, product strategy

Product Ops Unpacked: 4️⃣ tips every product pro needs to know ✍️

Join PM Evangelist, Axel Sooriah, & Product Ops. Consultant & Advisor, Jenny Wanger, as they unpack the role of product ops and discuss key takeaways in Atlassian’s ‘The Product Ops Mission’ guide. They’ll answer your questions live on May 6 at 9:00am PT.

Register here ⬇️
AUG Leaders

Atlassian Community Events