Forums

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

Warning Message/Pop Up Message

Elif Alverson
Contributor
May 29, 2018

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
Alexey Matveev
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.
May 30, 2018

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.

Elif Alverson
Contributor
May 30, 2018

 

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()

}

Alexey Matveev
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.
May 30, 2018

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 ("")

}
Elif Alverson
Contributor
May 30, 2018

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

Any idea why?

Elif

Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev , 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.)

Alexey Matveev
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.
May 30, 2018

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 ("")

}
Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev , 

Still no messages pop up. No change. 

image.png

Elif Alverson
Contributor
May 31, 2018

@Alexey Matveev , 

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

 

Elif

Kaushik Veluru
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.
December 17, 2020

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

小明哥
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!
November 8, 2021

@Elif Alverson Could you post your resolution?

0 votes
Alexey Matveev
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.
May 29, 2018

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

Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev , 

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

Alexey Matveev
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.
May 30, 2018

For example, like this:

def percent = getFieldByName("Percent")

if(percent.getValue()){
        percent.setError("This must be a number between 0-100")
} else {
        percent.clearError()
}
Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev , 

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

Alexey Matveev
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.
May 30, 2018

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.

Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev ,  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

Elif Alverson
Contributor
May 30, 2018

@Alexey Matveev

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

Alexey Matveev
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.
May 30, 2018

Ok. then change setError to setHelpText

Alexey Matveev
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.
May 30, 2018

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

Seshu December 20, 2018

@Alexey Matveev @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

Nick Dring
Contributor
March 1, 2019

Hi @Alexey Matveev 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

SMAtlassianMber
Contributor
May 29, 2019

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 ("")

}
Mark_Sattolo
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!
June 3, 2020

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