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

Warning Message/Pop Up Message

Hello,

 We have a custom Issue Type called “Changes“ and it has a few custom fields. One of the custom field is “ Risk Assessment” and it a drop down with the options of “ Severe , high, major, minor and none”.

 

Is it possible to have a message /warning / pop up to tell the ticket owner when the “ risk assessment” is picked as Severe or Critical  “ Assign this ticket to another Tech in your team“?

 

Is it doable? If it is, what would be the way to do it?

 

Thank you.

 

Elif

2 answers

1 accepted

0 votes
Answer accepted

You put the script into the wrong place. You should add the field. There is the add field button in the bottom of the screen.

 

def RiskLevel = getFieldByName("Risk Levels")

 

if(RiskLevel.getValue()){

        RiskLevel. setHelpText ("If Risk Level is High or Very High , assign this ticket to one of your team mates")

} else {

        RiskLevel.clearError()

}

Try like this:

def RiskLevel = getFieldByName("Risk Levels")

 if(RiskLevel.getValue() in ["High", "Very High"]){

        RiskLevel.setHelpText ("If Risk Level is High or Very High , assign this ticket to one of your team mates")

} else {

         RiskLevel.setHelpText ("")

}

@Alexey Matveev _cPrime_ , I am not getting any messages with this script you provided above.  I tried all the screens, but nothing.  

Any idea why?

Elif

@Alexey Matveev _cPrime_ , Custom field " Risk Levels" has set as select list multiple choice and it looks like below. If that helps?!

4- High (Change to critical system that will require downtime and is expected to impact service delivery. Reliable backups and back-off procedures in place.)

5- Very High (Change to critical systems that will require downtime and is expected to impact service delivery. Limited backups or back-off procedures.)

Try like this:

def RiskLevel = getFieldByName("Risk Levels")

 if(RiskLevel.getValue().findAll{it.toString() in ["High", "Very High"]}){

        RiskLevel.setHelpText ("If Risk Level is High or Very High , assign this ticket to one of your team mates")

} else {

         RiskLevel.setHelpText ("")

}

@Alexey Matveev _cPrime_ , 

Still no messages pop up. No change. 

image.png

@Alexey Matveev _cPrime_ , 

I figured out the issue. Thank you so much for your patience and help!

 

Elif

@Elif Alverson I wish you posted how you resolved the issue :) Am facing the same issue now. 

0 votes

Hello,

You can not do it out of the box. You need to use the Power Scripts add-on with the Live Fields feature or the ScriptRunner add-on with the behaviour feature.

https://confluence.cprime.io/display/JJUPIN/Live+Fields

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

@Alexey Matveev _cPrime_ , 

Thank you for your response. Do you have any sample scripts that I can use for https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Elif

For example, like this:

def percent = getFieldByName("Percent")

if(percent.getValue()){
        percent.setError("This must be a number between 0-100")
} else {
        percent.clearError()
}

@Alexey Matveev _cPrime_ , 

I apologize that I am not familiar with scripting. Here is what I did and nothing happens.

 

image.png

Should I add the value of the field Risk Levels ???? Any ideas?

if(RiskLevel.getValue(High, Very High)){

        percent.setError("If Risk Level is High or very high , assign this ticket to one of your teammates")

} else {

        percent.clearError()

}

 

 Thank you so much for your understanding.

Elif

You should add the RiskLevels field to the behaviour and add your script there. As a result you will see the error text under the field on the Create, Edit or Transaciton Screen. You will not see the message on the View Screen.

@Alexey Matveev _cPrime_ ,  Please see the screen shot below and based on what you said it should work, however I am not getting any message on any Screens.

image.png

@Alexey Matveev _cPrime_

I managed to see the message below, but now I am not able to pick a value for Risk Levels. It seems like something is blocking user to pick a value. Risk Levels is a required field for a submit for approval transition. I changed it to not required , but getting experiencing the same issue. Any ideas?

 image.png

Ok. then change setError to setHelpText

Kindly paste your final script here. There must be a couple of change made.

@Alexey Matveev _cPrime_ @Elif Alverson  We have a similar situation where we want to display a message when a particular field is updated to a particular value. After following exactly the various suggestions made here, I still don't see the message.

Our Scenario : The custom field 'Client Status' has different values,but when the user updates it to 'Closed', we want to display a message reminding them to attach the approval form.

The script currently looks as given  below but please let me know if any changes needed. I have also added the field 'Client Status' to the behavior (Add Field)

===========================

def ClientStatus = getFieldByName("Client Status")

if(ClientStatus.getValue() in ["Closed"]){

ClientStatus.setHelpText ("Please make sure to attach production approval when client status is closed")

} else {

ClientStatus.setHelpText ("")

}

=============================

Thanks

Hi @Alexey Matveev _cPrime_ I'm trying to do something similar so that when someone uploads a file via a service desk request a message appears after the file has been uploaded. Can this be done?

Cheers

Hello @Elif Alverson  - I am trying to accomplish the same thing, but I need a message displayed when issue type - feature is selected. Any suggestions would be great. 

Behaviour - mapped to all projects, Issue Type feature

Fields  - Issue Type

Script 

def issueTypeSel= getFieldByName("Issue Type")

 if(issueTypeSel.getValue().findAll{it.toString() in ["Feature"]}){

       issueTypeSel.setHelpText ("Message")

} else {

        issueTypeSel.setHelpText ("")

}

Trying to do the same type of thing with a date picker field using ScriptRunner version 6.1.0 and JIRA Server 7.13.13 but I'm not seeing the help.  I've also tried to set the error and description and nothing...  Finally, I've added a log.info statement and I see that my code is being executed but I don't see anything on the screen.  Any ideas?  Thanks.

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