Scriptrunner behavior plugin - removes read-only fields when user changes "Configured Fields" settings

We've configured a specific custom field to be readonly in Scriptrunner's Behavior plugin.

We started noticing that for some issues, the value for the readonly field is being deleted. The issue history shows this action as a regular field edit operation (ie. it wasn't a Move or something else)

We discovered that the readonly custom field in question is being blanked out, whenever a user goes into Edit Issue mode and then clicks on Configure Fields to change the default field selection. If the user customizes the fields, and adds the readonly custom field to his field selection, this field is blanked out but stays un-editable.

And when the user commits his other unrelated changes, the value of the readonly field is then lost.

We're running JIRA 6.4.12 and the latest Scriptrunner version 4.1.3.16

Any ideas why this is happening ?

 

This is the XML for the field configured in Behaviour:

<config use-validator-plugin="false" name="ExternalissueIDReadOnly" description="Make External IssueID readonly" guideWorkflow="null">
<field id="customfield_11904" required="null" readonly="true" hidden="null"/>
</config>

2 answers

I also met this behavior when I tried to change fields displaying. I hid the field by using of Behaviors, and it appeared when I was customizing fields view. I could be able to change a value of the field. And then it disappeared again.

0 vote

This is not handled at the moment - https://productsupport.adaptavist.com/browse/SRJIRA-233

Some users have disabled the Configure Fields dropdown using javascript, but I don't have the details of how.

 

I've encountered some problems as well with the "Configure Fields" dropdown, namely the default Description via Behavior will replace anything within the description field when the dropdown is applied...

I am trying to catch this within the script, but can't figure out what to look for. Things like getFieldChanged(), getActionName(), and underlyingIssue?.description don't give any reasonable result (Null pointers or "Create", just as if the screen just popped up). Do you have any good guess on how I might try to see that the "Configure Fields" dropdown has just been applied by the user? That would be of great help to create a workaround for this issue.

Not really... I guess when we start working on it we'll know how to do it... nothing I can share at the moment. I doubt you will be able to fix this issue using the current API.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

233 views 1 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you