Making a field required ONLY when closing a ticket?

Tara Asch March 25, 2016

How can I find out the status of this: (I don't want to use a validator)

  • Be aware that there is a feature request (JRA-5783) to make a field required for only one transition. If you are interested, please watch that issue for status updates.

4 answers

2 votes
Jobin Kuruvilla [Adaptavist]
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 25, 2016

Unfortunately, using validator is the only option now. Any reason why you can't do it?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2016

Indeed.  I don't quite understand "I don't want to use the method that is designed to meet this need, and is the only way to do it"

Like Rob Covey likes this
Jobin Kuruvilla [Adaptavist]
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 26, 2016

smile

1 vote
Robert G. Nadon
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 26, 2016

The only difference between a validator and a required field is that you get a red * on fields that are required in a regular way.  When using a validator it does not show a red *.  I agree that this is a minor thing, but my user base has complained about it to me, that it is inconsistent. I explained that the red dot means it is required at all times, and not just during the transition, but I got blank looks back.  It would be a neat feature to have the validator add the red star whenever the conditions are met to make the field required but that would be some work, as the scripts can be fairly complicated.

OK, off the soapbox.

Next smile

Robert

Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2016

If they can't be trained for this minor difference dump them. I find it best to only put required fields on transitions. If you do that it will make the training simple, if it's on the screen it is required for the transition. If they don't fill in the field the transition won't proceed and they get a message they need to fill it in. The exception would be the comment field JIRA automatically adds to all transitions. You'll never be able to code around all user errors.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2016

I'd like the red * to get rid of the handful of "it didn't tell me" complaints, but as someone who has used JIRA for <mumble> years, I don't really care.    I fill in the fields I think I want to, click go, and when I miss a mandatory one, it tells me (unless the admin has set up a bad validator that doesn't)

Totally agree it's a very "nice to have".  But given the stuff I want Atlassian to do, it's a hundred and eleventy twelve on the list...

Robert G. Nadon
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 26, 2016

Agreed Nic.  a hundred and eleventy twelve lol never heard that one before.   Just pointing out why someone might not want to add a validator.  And Joe, I cannot dump my users as that is my customer, but I can tell them hey that is just the way it is, live with it.    Yeah it is so minor that I will not even create a change request. 

Jobin Kuruvilla [Adaptavist]
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 28, 2016

I have heard it a lot that I ended writing this: http://www.j-tricks.com/tutorials/silly-javascript-hacks-or-is-it

Robert G. Nadon
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 28, 2016

Wow Jobin, very cool.  Though neither your javascript nor Jamie's work for me.  sad I copied and pasted directly into my custom field's description, and then changed the customfield number to match mine and no luck.  here is the code I added:

<script type="text/javascript">
AJS.$("#customfield_10500").parent().children('label').append('<span class="aui-icon icon-required"></span>');
</script>

No star, on the transitions it is required and non on the ones it is not.  THis one is required on create when the custom field "who found" = customer.

I also tried:

if (!AJS.$("#issue-workflow-transition input[name=action]").val()) {
AJS.$("#customfield_10500").parent().siblings('label').append('<span class="aui-icon icon-required"></span>');
document.getElementById('customfield_10500').value = getCurrentUserName();
}

no bueno...

Robert G. Nadon
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 28, 2016

I also tried it on a less complicated one that was only required on a transition (no script for the validator) and still no star.  I really do not know js enough to know why...

Jobin Kuruvilla [Adaptavist]
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 28, 2016

The DOM elements might have changed over the versions. Also, the elements are different for different custom field types. You might find some examples in the comments section. You just need to find the one in your JIRA version, for you custom field and modify the script accordingly.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2016

There is a difficulty here.   In a lot of cases, validators are simple.  "What is the flight speed of an unladen swallow"?  The answer is mandatory, so you can and, exactly as you say, tell the user that somehow (like the red asterisk)

But it fails for more complicated validators.  Field is mandatory is one of the simple cases, but if you code a validator for "If it's Tuesday and it's an African swallow instead of a European one, and it may or may not be carrying a coconut shell" - how do you decide to put the red asterisk in.  Or a validator that says "date must be empty or in the future". Or. Or. Or.

I am absolutely 100% behind the idea of "if field is mandatory, tell the user".  Much as I love Atlassian stuff, there are two big howling flaws in JIRA right at the top of my "seriously? just fix it" list.  One is resolutions/done (discussion not relevant here), and the other is the way fields are handled.  I would NOT change validators.  But I'd throw "field is mandatory" validators in the same scrap-heap as "field configurations" and move all of that junk into screens.  If you could flag a field as mandatory in a screen instead of a config or a validator, the problem goes away because the screen knows it's needed and can pop the red flag.

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2016

They won't implement it. The supported jira-suite-utilities gives you the ability. They've already pointed to it as reason not to implement it or something else it does.

0 votes
Elifcan Cakmak
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 25, 2016

Suggest an answer

Log in or Sign up to answer