Forums

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

I want to pop up a warning message once the user click on the edit button of any jira issue. how ca

Priyanka khare
Contributor
March 30, 2021

Hello ,

 

I want to pop up a warning message once the user click on the edit button of any jira issue. how can I do this?

 

Regards,

Priyanka

2 answers

1 accepted

1 vote
Answer accepted
Lih Yao Tiong
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.
April 1, 2021

Hi @Priyanka khare

I agree not to inject code into the core of Jira.

Here's my suggestion:

If you are trying to avoid a specific user or group to edit the field, I would like to suggest using ScriptRunner Behaviour to set the field read-only for a specific user instead of pop up a warning message while clicking on the edit button.

.setReadOnly(true) helps to make the field a read-only field, and the user cannot edit the value inside the field.
Please refer to the document: https://library.adaptavist.com/entity/set-behaviour-read-only

I think .setError() is good enough to display some information to the user.


Also, this script should only work while the user on edit screen.So to tell if you are in the Edit dialog, you just need to check that the value returned from the method is null like this:


if (getActionName()== null){
//your code
}

It's a little strange, but the getAction and getActionName methods should return a null value when on the Edit issue dialog.

Lastly, to make sure this Behaviour script only applies to a specific group, you can add a condition to check on the user's group/project role: https://docs.adaptavist.com/sr4js/6.22.0/get-started/tutorials/behaviours-tutorial

I hope my suggestion makes sense to you.

Priyanka khare
Contributor
April 1, 2021

Thankyou @Lih Yao Tiong 

0 votes
Nic Brough -Adaptavist-
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 30, 2021

Code - you'll need to inject code into the core of Jira so that it triggers your pop-up instead of taking people to the edit screen.

I would recommend not bother to do this though, because

  • code change like this renders you unsupported
  • humans don't like pop-ups, they get in the way and irritate us

It would be better to explore why you think this is a worthwhile/helpful change?  What problem are you trying to solve with this idea?

Priyanka khare
Contributor
March 30, 2021

I am restricting people from editing the jira issue but at the same time I also want them to know why they can not edit.. and for that I need to have a pop up message. @Nic Brough -Adaptavist- 

Nic Brough -Adaptavist-
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 30, 2021

If you remove the edit permission, the edit button goes away completely.  There's nothing to click to trigger the pop up.

I don't think you have a problem here.

Suggest an answer

Log in or Sign up to answer