Hide fields based on status using JQuery or Java script

I need to hide some fields in Edit screen based on the status(open,resolved etc) of the issue.How can I get the status in Jquery or Java script

2 answers

1 accepted

0 vote

Status won't be there on the edit screen.

You might want to use workflow operation to edit the fields where you can direct to different transitions based on workflow status each have a different screen!

1 vote

It's not on the screen but you can get it like this:

AJS.$.get(AJS.params.baseURL + "/rest/api/2.0.alpha1/issue/" + AJS.$("#key-val").text(), function (data) {
    console.log (data.fields.status.value.name);
})

BTW you can do this with the behaviours plugin without writing any code.

Ah REST! Nice one..

Hi Jamie,

I am not able to store the status in a variable.My intention is to hide some fields in the "Edit Screen" base don the status.

Regards

Anoop

So, if data.fields.status.value.name is Opened, then you hide the field. You should try this with the behaviours plugin, no coding is required at all for hiding fields based on status.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 12 hours ago in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

86 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you