Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to make a field as mandatory

Hi,

 

I was strucked up in making a Field as mandatory while moving from one transition to another.

Basically, I know it how to do by using a Validator 'Field Required'. But my concern is I already have an automation to update the field with some text while creating. 

But I need to make the users to fill that information in field, then only they can be able to move the transition from one to other.

Please anyone suggest me with the solution.

Thanks in Advance

2 comments

John Funk Community Leader Oct 14, 2021

Hi @Jyothi Ravipati 

I am a little confused by your question. 

Why can't you just add the validator to make the field required? It shouldn't have anything to do with your automation rule that fires on create, unless your validator is on the Create transition. 

Hi John,

Thanks for your quick response.

I will explain you clearly.

I have a field named 'Root Cause' with auto filled text(Having Questions) while creation of issue.

So when I make a transition change from one status to other, I need to make sure that whether the text with questions are answered or not. 

What is the procedure for doing so?

If I have added a field required validator, it is not working because the field is not empty, and already having some text there.

John Funk Community Leader Oct 14, 2021

Oh, that's a little more complicated then. One way to to use a third party add-on like JMWE or ScriptRunner to check the value/size of the field to see if it is larger character wise. 

An out of the box solution might be to create another custom text field and populate it with the values of the Root Cause field when it gets updated. So an automation rule that triggers on Root Cause value changed, then do an action to Transition issue to "To Do". You would have a validator on the transition to "To Do" to make sure the new custom field is populated.

Or if you want the Root Cause to be the final field, start with the new custom field having the questions and needing to be updated, and then copy the value to the Root Cause field. 

Hi John,

We do have An add-on JMWE, But may i know how to work with that to get the required solution?

 

As this needs to be done for a single transition in a workflow.

John Funk Community Leader Oct 14, 2021

You would create a custom validator for that transition, but I am not a nunjucks expert and not sure of the syntax. 

@David Fischer _Appfire_ could you help? 

Hi @Jyothi Ravipati 

the problem is: how do you know if the user really answered the questions if they are just freeform text in the field? You could check that the length of the text in the field is greater than a certain number of characters (the initial length of the value that's pre-filled, plus a minimum expected number of characters the user must type) but that's no guarantee.

To check the length of the text, you can use a Build-your-own Validator with this code:

!!issue.customfield_12345 && issue.customfield_12345.length > 500

where issue.customfield_12345 needs to be replaced with the custom field ID, and 500 with the expected minimum length.

John Funk Community Leader Oct 14, 2021

Thanks, David!

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

759 views 17 21
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you