Forums

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

How to hide a custom field based on workflow status in jira cloud

Netspective QA
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2018

We have a requirement of hiding custom field based on workflow status.

Is there any configuration available in jira cloud to achive this?

(eg:-  If  Workflow "Status" value is  'open'  then  show "Custom field A" and "Custom field B"

        if Workflow "Status" value is  'Inprogress'  then  show "Custom field A" ,"Custom field B" and "Custom field C"

       if Workflow "Status" value is  'closed'  then  show "Custom field A" ,"Custom field B" , "Custom field C" and "Custom field D")

 

1 answer

0 votes
mfabris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2018

I think a solution could be by keeping Edit and View screen separated. Custom fields do not show in the view screen unless they have a value, so you can play with this.

I would solve it like this.

 

1. Keep an "Edit" screen for all your issues, withonly custom field A and B

2. However in the "View" screen all custom fields A B C and D can be seen. However keep in mind that they will not be seen if they do not have a value.

3. Create transition screens for each one of the statuses, where the user is prompted to add the values. For example, the screen for the transition to "in progress" there will be the field "C".

4. If the user adds a value there, then it will show in your "View" screen.

5. You might want to change the value for the field C though, and you cannot do it from the edit screen. Therefore you can add a transition from "In Progress" to itself using as the same transition screen you used from "open" to "in progress".

6. Repeat the above for the transition between "in progress" and "closed".

I think this is the clean way to go, which I would recommend

 

The other way to go is the nasty javascript hack. 

The base would be

<script> 

if ($("#status-val").text("in progress")) {$("#rowForcustomfield_12345").hide();}

</script>

Change "in progress" with any other status you want, and make sure you amend correctly the id of the custom field.

 

 

I hope it helps

Randal Jew August 2, 2018

We want to do the same thing.  I'm new to Jira.  Where would we insert that javascript at?

mfabris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2018

Hello Randal

There are two places where you can do it. Either in the space for the "Announcement Banner" or in the description of a custom field.

The first option is very drastic, as it will affect the whole system/all projects. 

The second option gives you the possibility to use one custom field just for one project and inject the JS in the description of that custom field, so you are sure this JS runs only when the field appears.

Still, it is a nasty hack so make sure you test it well and be prepared to surprises

 

Good luck with it!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events