how to pop up a dialog box and prevent submitting when on a condition in behaviours plugin?

fabby June 30, 2012

what i want to implement is preventing some one from selecting 'reject ' as resolution.

so when he click 'submit' button,a warning dialog box should pop up prevent he from submiting.

any one knows how to implement in development.

my jira version is 4.4.1

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Mizan
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.
July 2, 2012

Hi Fabby,

Have you seen this example of behaviours plugin . I guess what you need is similar to this , you just need to modify the code to suit your requirement.

fabby July 2, 2012

Mizan,

the field "resolution",how can i use method setHelpText(),setValid() or setError() ?

it is strange to put warning message (such as "you don't have permission to reject issue")on other field(not resolution field)

Mizan
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.
July 2, 2012

>>what i want to implement is preventing some one from selecting 'reject ' as resolution.

You want a specific user not to select 'reject' as resolution ,right ?

fabby July 2, 2012

yes,

on Resolve screen,we shall put resolution field on it.but on Close or Reopen screen,we don't need to put the resolution field on it.

Mizan
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.
July 2, 2012

I am sorry but the question is still not clear to me .

Do you want the resolution field only on resolve screen ?

Or do you want the 'reject' option to be selectable only to some user and only on resolve screen ?

fabby July 2, 2012

hi,Mizan

1 Resolution has Fixed,Incomplete,Duplicate,Reject,Reproduce as its value.

2 Resolution is on the Resolve Issue Screen,but not on the Reopen or Close Issue Screen.

3 only software leader have reject permission when Resolve Issue,and only test leader have reject permission when Reopen or Close Issue.

Mizan
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.
July 2, 2012

In your script you will have to first check whether the current user has a required permission if not then remove the option "reject" from the resolution field .

REmoving the option can be done by applying a javascript using setHelpText() method provided by behaviours plugin.

fabby July 3, 2012

hi,Mizan

i have said the field "Resolution" is not on Reopen or Close Screen.

suppose there is one issue whose status is "Resolved" and Resolution is "Reject",then only test leaders shall have permission to reopen or close this issue.

fabby July 4, 2012

anyone can tell how to prevent submit and git a warning message in code?

Mizan
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.
July 4, 2012

What you need is a workflow validator which will validate the given condition before reopen or close issue .

fabby July 22, 2012

thanks Mizan,

using workflow plugin:script runner can implememt it.

this page is the resolution:https://answers.atlassian.com/questions/70196/how-to-set-complex-validators-in-jira-s-workflow

0 votes
Jobin Kuruvilla [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.
June 30, 2012

What you need is a workflow validator and not a popup!

Ans if you want to prevent reject from appearing in the list, you can use workflow properties.

fabby July 2, 2012

hi, Jobin

my problem is the field "resolution" is not on the action screen.and only specified people have the reject permission.

TAGS
AUG Leaders

Atlassian Community Events