JIRA Behaviours Plugin - Freeze (read-only) Due Date and Due Date & Time fields in a certain Project.

Jose Daniel Rodriguez February 23, 2015

We need to freeze (read-only) Due Date and Due Date & Time fields in a certain Project. No users should be able to change or modify these fields, only project admin role should be able to edit this field.

I was able to apply these changes using the behaviours plugin by adding these fields, made them read only and added the condition to all steps. The problem is that these two fields are also impacted on the create issue screens, that means that the users will not be able to add the due date when creating the ticket.

Is it possible to make these two fields read only in all steps of the workflow using behaviours plugin but not in create issue screen?

Please let me know if there is any additional information needed on this regards.

Thanks!

2 answers

0 votes
John Parsons October 29, 2015

@Jose Daniel Rodriguez I'm almost a year late, but I just ran into this myself and was able to get by it but adding another condition to my behaviour, an 'except' condition for just the 'Create' step.  This appears to be working for us.

So in our case, we're restricting a field to 'Readonly' when it's in an 'On Hold' status, and like you, when we created a ticket, it was also restricted at that step.  Addind another condition (except) to the same behaviour, for action 'Create' solved this for us.  Creating tickets works as expected, the field is not restricted, and then when it goes into 'On Hold' is is restricted.

 

Conditions:

  • When:
    • For step: On Hold (9) 
  • Except:
    • For action: Create (1) 

 

0 votes
JamieA
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 24, 2015

In the most recent version you can use the initialiser function. In all cases other than create there will be an issue already created, so you could use something like:

if (! getUnderlyingIssue()) {
    getFieldById("duedate").setReadOnly(true)
}

Suggest an answer

Log in or Sign up to answer