Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How works Hidden field in issue creation

Hello,

I don't understand how works hidden field when you create a new issue on Jira Service Desk.

We have a desk for our customers to create issues. The have for exemple, to select the computer which has a problem, and then there is an automatic update of 10 fields, like the name of the computer, the user associated, phone number, and also, some informations than must be read-only, like our intervention delay, the contract... All of these are stored in a database.

I don't want our customers to see those particular fields, they must be hidden for them, BUT, filled during the automatic update, and then stored during the creation of the issue. If I hide a field, it seems to be in read-only, as it is empty each time.

Is there a way to store variable in hidden fields?

1 answer

Hey Deniel,

We can do this, if we have Adaptavist Script Runner Plugin Installed.

 

Lets say you want to hide field B and FieldC based on the value of Field A.

 

Add a mappping to the Issue Type,Project and then add a field A 

Maping-Behavior-Projects.PNG

In this example, its OS

ScriptRunner-Behaviors.PNG

 

Code to hide OSVersion Field based on OS field value

import com.atlassian.jira.component.ComponentAccessor
def OSVersionField = getFieldByName("OS Version")
def OSField =getFieldById(getFieldChanged())
def selectedOption = OSField.getValue() as String
if ((selectedOption == null))
{
   OSVersionField.setHidden(true) 
}
else if ((selectedOption == "All"))
    {
        OSVersionField.setHidden(true)
    }
else if ((selectedOption == "N/A"))
    {
        OSVersionField.setHidden(true)
    }
else
    {
        OSVersionField.setHidden(false)
    }

 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you