making a field mandatory based on status

Manish Pathak January 5, 2017

I have a screen where developer enters specifications and submits for review. Reviewer can return or accept the specs. In case specs are rejected, reviewer enters comments and returns. Developer has to then read the comments, modify the specs and resubmit. In the custom screen used for entering specs and review comments, I have created a field where the reviewer has to mandatorily enter review comments.

But the problem is that the same screen is used to enter spces. Due to this, system checks for mandatory condition even when developer wants to submit the specs first time. Ideally, I would want the following:

  1. Field should not be mandatory for the developer, 
  2. and should be read-only as developer should not be able to modify any comments entered by the user

Is this possible?

 

2 answers

3 votes
Sam Hall
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.
January 5, 2017

One option to make a field read-only is to create different "edit" and "view" versions of your issue screen and associate them with the Edit issue and View Issue operationsmaking sure the read-only field is not on the "edit" screen.

To allow the 'read-only' field to be set at the right point in the workflow, put the field on another custom screen and associate the screen with the relevant workflow transition. As Aylin says, you can make it mandatory using a transition condition in the workflow.

Sam

Manish Pathak January 5, 2017

First of all, many thanks to both of you for answering so quickly!

I was able to follow the suggestion by Aylin (and Sam) to set the 'mandatory' property to the field as required.

But Sam, the approach to make the field read-only seems to be quite convoluted - isn't there something more simple? 

Thanks,

Manish

Sam Hall
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.
January 6, 2017

Hi Manish,

There's nothing more simple that I know of I'm afraid, and it's not too hard if you get your screens set up right. It's basically the solution described here.

For your scenario you would need something like:

  • View issue screen (including your 'specifications' and 'review comments' fields and whatever other fields you want to display when people view your issues).
  • Edit issue screen (including any fields you want to be editable when people click the "Edit" button, but not your 'specifications' and 'review comments' fields).
  • Submit for review screen, set up show when a developer does your 'submit for review' transition, including your 'specifications' field, which can be made mandatory with a transition validator.
  • Review screen, set up show when a reviewer does your 'reject' transition, including your 'review comments' field, which can be made mandatory with a transition validator.

This assumes you are OK with the 'specifications' and 'review comments' fields only being visible on the issue view screen.

i.e. the developer will see the 'review comments' and 'specifications' fields when viewing an issue. They will only be able to edit the 'specifications' field by clicking 'submit for review'. The 'review comments' field won't show while they are doing this (otherwise they'd be able to edit it too!).

If you really want read-only fields to be displayed during the transition, the above won't achieve it.

Your other options could be:

See also:

how to make a field non-editable after workflow transition?

This comment on https://jira.atlassian.com/browse/JRA-35727

https://jira.atlassian.com/browse/JRA-1330

2 votes
Aylin Kohls
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.
January 5, 2017

Hi Manish!

The first part of your question is simpler, you can set a field as mandatory depending on status, using a transition condition in workflow.

But making it read only is more complex, I think you could validate via transition condition too, that Developer not change its value, but I don´t know how to not allow to edit it...

Regards, Aylin.

Suggest an answer

Log in or Sign up to answer