Hello dear community,
I'm switching our Jira Server Version to Jira Cloud. On the server version we used ScriptRunner for Validators and Post-Functions.
On the Server version it was easy to create a validator in the workflow, which checks if the value of a defined custom field was changed or not. In the Cloud version I need Jira expressions for this. Unfortunately, I'm not an expert in Jira expression.
I would really appreciate if someone can help me with this requirement:
As a Jira admin I want to have a validator in the workflow (field changed validator) to make sure, that the value of a custom field (cascading select list) was changed before the transition.
Thanks a lot in advance.
Best regards,
Tamir
For your requirement, you can use the ScriptRunner Script Validator as shown in the screenshot below:-
Once you are in the editor screen as shown in the screenshot below:-
You will need to enter a condition like this:-
issue.customfield_10114.child.value.length > 0
Please note you will need to change the custom field id according to your environment.
This sample code is also available in the ScriptRurnner for Jira Cloud Documentation.
Below is a screenshot of the complete configuration:-
I am also including a couple of test screenshots for your reference:-
1) First I create a new Issue. For now, the value of the Cascading Select List is not set as shown in the screenshot below:-
2) I try to transition the issue to In Progress and as expected the validation error is displayed:-
3) Next, I update the Cascading Select List and select some options for it and try to transition the issue to In Progress. As expected, the transition works successfully as shown in the screenshot below:-
I hope this helps to solve your question.
Thank you and Kind regards,
Ram
Hello Ram,
thanks for your fast respond. I really appreciate this!
This Jira Expression just checks if the field is empty, right?
My requirement would be an expression that checks, if the values in the custom field has changed.
Could you also help me with this?
Thanks in advance and best regards,
Tamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the one above will check if it's not empty.
Field has been modified Validator <- this one will not do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Lukasz,
"field has been modified Validator" was available in the Server Version for ScriptRunner, but unfortunately not in the Cloud Version. There I have to use Jira Expression and that's where I'm stuck...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.