Forums

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

How to get custom field value using Jira workflow validator

이정왕 March 8, 2023

Hello,

I am using Jira Cloud.

 

How to get custom field value using scriptrunner in Jira workflow validator?

I need to use Jira expressions.

aa.PNG

 

Thank you.

3 answers

2 accepted

1 vote
Answer accepted
Alex Koxaras -Relational-
Community Champion
March 9, 2023

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.

이정왕 March 12, 2023

I'll be waiting for @Alex Koxaras -Relational-  reply.

 

Have a nice day ~!

Thank you.

Alex Koxaras -Relational-
Community Champion
March 13, 2023

@이정왕 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. 

이정왕 March 13, 2023

Hi @Alex Koxaras -Relational- ,

 

This means a lot to me.

Thank you for your reply.

Alex Koxaras -Relational-
Community Champion
March 14, 2023

@이정왕 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!

0 votes
Answer accepted
이정왕 March 9, 2023

Hello,

 

I have one more question.

How to call Rest api for custom field value in Workflow Validator in Jira Cloud?

 

 Thank you.

Oliver Siebenmarck _Polymetis Apps_
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 13, 2023

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.

이정왕 March 13, 2023

Hi @Oliver Siebenmarck _Polymetis Apps_ ,

 

I couldn't have done it without you.

Thank you~!

0 votes
이정왕 March 9, 2023

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events