How to make a custom field with a default value be required on create?

Jake McCoy July 26, 2021

My issue is this: I created a new custom field with the Multi-Line Text type. This field is labeled "Report Values/Columns" and is set to use a wiki renderer, which I've set to a default 4 column with headers, 3 row empty table. My intent with this was to provide a template for users to begin from when entering their report requirements. Also, the field is set to required; however, on the create/edit screens this field doesn't require entry BECAUSE of that default table. It considers the field already filled by default, which means users can still create the ticket without modifying the field.

Is there a way to make this field continue to be required, even when the default table is there? 

1 answer

1 accepted

2 votes
Answer accepted
Payne
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.
July 26, 2021

The JMWE, ScriptRunner, and JWT (and possibly other) apps offer a "field must be changed" validator that you could use. Without an app, though, I don't know if you can accomplish your goal.

Jake McCoy July 26, 2021

Do you have a sample of that validator? I'm actually doing a trial of ScriptRunner as we speak to see if it will be useful for my team or if it will just create a single point of failure in terms of knowledge base. But if the pros outweigh the cons I may decide to keep it!

Payne
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.
July 26, 2021

Hmm, well, I tried adding ScriptRunner's validator to the Create transition, and it did not list any of my issue's fields, stating that it displayed only fields that are present in that particular transition (which many are on the Create transition). A small script could be written with their app; that would be a little more involved, but doable. ScriptRunner in general is a very useful app and one that I recommend.

I accomplished your goal with with JMWE, another app that we find useful. I simply added a validator to the Create transition and chose the field that I wanted to require to be changed. I added a default value as you have, and it works as expected.

Jake McCoy July 27, 2021

@Payne I've been attempting ScriptRunner's validator to no avail on my Create Task transition just for test purposes, and no matter which way I go to access the workflows, I can't get the Field(s) Changed Validator to work properly. Every time I get to the screen to select which field needs to be validated, it says there are no fields available.

validator.jpg

Jake McCoy July 27, 2021

I just figured out my issue. My team's transitions were not set up to use screens, they were essentially just a barebones transition. Once I set up our "Create Task" transition to use the Create Screen, everything worked using our Business Justification field as a test case. Thank you @Payne 

validator 2.jpg

Like Payne likes this
Payne
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.
July 27, 2021

Excellent, @Jake McCoy - glad you got it working!

Ahmad Al-Shaibani
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2021

@Jake McCoy hey mate, do you mind letting me know how exactly you achieved this? I've ran into a similar issue! Thanks

Jake McCoy October 22, 2021

@Ahmad Al-Shaibani it's important to note that my team paid for ScriptRunner and is using the out-of-the-box validator seen in the screenshot. On your "Create Task" or story, or whatever Transition, you need to be sure the Create transition is associated with a Create Screen otherwise your validator will not be able to find any fields to validate.

Change Validator 1.png

Change Validator 2.pngChange Validator 3.pngChange Validator 4.png

Like # people like this
Ahmad Al-Shaibani
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 22, 2021

@Jake McCoy brilliant, thank you so much!!

Like Jake McCoy likes this

Suggest an answer

Log in or Sign up to answer