Show custom fields and make them readonly at the same time

I do have a custom field type (A) which I can't make readonly in a certain workflow step with ScriptRunner (It's probably not supported).
Let's say I do have the workflow steps Status 1, Status 2, Status 3 

My workaround is to create a new JIRA custom field (B).

  1. Copy the value of the  customfield (A) into (B) during transition from Status 2 to Status 3 
  2. Customfield (A) is visible in Status 1 and Status 2 
  3. Custom field (B) is not visible in Status 1 and Status 2 
  4. Custom field (B) should be shown in Status 3 and defined as readonly.

Problem with Behaviours is that I cant differentiate between Hiding and making a field Readonly for different statuses.

Is there a way with a script to solve the problem?





1 answer

1 accepted

1 vote
Accepted answer

In a behaviour you can check what workflow step or action you are currently on if you attach a server side script to the initialiser or one of the fields. Please see example #7 here.

You can modify the example to be something like:

if (getActionName() == "Start Progress" || getDestinationStepName() == "Done") { // <7>
} else {

This should achieve what you want.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,708 views 17 21
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