Is it possible to show a filed in validator ?

Vishal
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.
February 6, 2020

Hello Guys,

I have a custom field whose value changes in screen transition, based on the value, I need to show a field & make in mandatory using validator. Is it possible ? if yes do let me know.

3 answers

0 votes
Simon H
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.
February 6, 2020

It sounds like you might have already invested a fair amount of time into designing the relevant screens, in which case ScriptRunner or PowerScripts are probably your best apps; however, ProForma forms could help you do what you want with the following features: 

Forms instead of screens

You can use the form builder to easily layout the required fields, add validation requirements to individual fields, and include instructions or tips for users to follow.  

Link fields in a form to Jira fields

Using linked fields in a form means that the form will display the same value as the Jira field. 

Conditional Logic 

Use conditional logic to show or hide sections in your form based on the specific values in the linked Jira field. For example you could ask for additional details if the Priority is set to High or Highest. 

Automation & Workflow Validation

You can build an automation rule that automatically transitions the issue to a new status once the form is completed. This saves the user from having to fill in the form and then manually transition the issue.

Likewise you can also add a validator to the workflow so that the user cannot transition to the new status if the relevant form is not attached or submitted. 

Full disclosure: I am the PM for ProForma, but we have built ProForma to answer the very question you raised.  

Vishal
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.
February 7, 2020

Hello Simon, thanks for the info, this looks cool, I would give a try for sure.

0 votes
Andrew Laden
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.
February 6, 2020

Sounds like you want two things. Treat them as such

1: In a transition screen, if field 1 is set to a particular value, then show field b. else hide it.

Scriptrunner can do that(I think, i don't use script runner, I use power scripts which am pretty sure can do it as well)

2: In a validator, if field 1 is set to a particular value, then field B must also have a value.

Again you can do this with scriptrunner. Or with JSU etc.

Validators run after transition screens are processed. So you get you transition screen, and click submit, then the validator runs to make sure that everything is ok. ifs its not, it pops the transition screen back up for you to make corrections.

Vishal
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.
February 7, 2020

And that is exactly what I am doing right now but was looking for something to solve the purpose with just validator. But seems like this is the only way.

0 votes
Leonard Chew
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.
February 6, 2020

OOTB you can't do that.

You'll need an add-on, such as scriptrunner.
With scriptrunner you can set field behaviours on transition screens (conditionally show/hide/set mandatory).

Vishal
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.
February 6, 2020

I have managed to do it using behaviours but was searching for a way if at all possible to do using workflow validator.

Leonard Chew
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.
February 6, 2020

So you are already using scriptrunner?

In a scripted validator, you can conditionally make a value mandatory, but I think you will not be able to hide/show the field within the screen.
So if you only want to make the value mandatory (and dont care if the field is visible all the time), then you can also use a validator.

Vishal
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.
February 6, 2020

Yes, we do have script runner but we I am using validator to validate attachment field, hence looking a solution if it can also show up the field as well.

Suggest an answer

Log in or Sign up to answer