How do I prohibit issue creation(or change) with certain custom fields values?

e October 15, 2013

Hi! I have jira 6.0.8.

How do I prohibit issue creation or change if customfield_1 has value "In development" and customfield_2 has value "None"? Any other combination of values is allowed - the issue can be created or changed.

Is it going to be a listener?

I'd appreciate any help. Thanks!

2 answers

0 votes
RambanamP
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.
October 15, 2013

using script runner validator you can achive this

simple script validation you can do as follows

cfValues['customfield name1']?.value == 'In development' && cfValues['customfield name12']

check here more about script runner plugin

https://jamieechlin.atlassian.net/wiki/display/GRV/Script+Runner

check this it will help you

https://answers.atlassian.com/questions/216574/simple-script-failed-to-validate#comment-217731

e October 15, 2013

rambanam prasad Thanks!

So, all I have to do is I have to put this:

cfValues['customfield name1']?.value == 'In development'&& cfValues['customfield name12']

in "Simple scripted validator" (Runs a simple embedded script to find out whether to allow the transition or not) of my transition?

RambanamP
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.
October 15, 2013

yes and don't forgot to update custom field names :)

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 15, 2013

A listener is too late - any changes will have been committed already.

You can do it in validators in the workflow, but there's nothing to stop someone performing edits that you cannot validate like this. The best you can do is block edits completely with the "do not allow edit" property on the workflow steps you need to stop them at, and moving your edit down into the workflow.

e October 15, 2013

Thanks a lot!

But anyways, what if I want to control edition? How do I catch the event when someone is trying to edit the issue?

Suggest an answer

Log in or Sign up to answer