Hello,
I am using Jira Cloud.
How to get custom field value using scriptrunner in Jira workflow validator?
I need to use Jira expressions.
Thank you.
Hi @이정왕
Jira expressions can be found here https://developer.atlassian.com/cloud/jira/software/jira-expressions/
But it would be great if you could share with us, what are you trying to accomplish. Maybe we can help you find a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@이정왕 kindly check this page for examples https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/validators/example-validators
The logic is that you've got to find your custom field id and compare it with a value. Your requirement is "So if its value is Y, it prevents creating an issue.". That could be entered as:
issue.customfield_XXXXXX.value == "Y"
Something along these lines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@이정왕 if you got this thing working, kindly mark my answer as resolved, in order to help others in the community with similar questions. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have one more question.
How to call Rest api for custom field value in Workflow Validator in Jira Cloud?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @이정왕 ,
In Validators (and conditions for that matter), you cannot use the REST API to load any data. Unfortunately, that also means that there is no way to read the actual asset data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Alex Koxaras -Relational-
Thank you for your reply!
What I'm trying to achieve is:
First, read the value of one custom field.
Read the value from the asset object connected field to the field called the request target and put it into another custom field value.
So if its value is Y, it prevents creating an issue.
It is by using a script runner in the validator in the workflow.
Thank you.
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.