I'm encountering an issue with ScriptRunner in Jira when trying to update a custom field that is intentionally not present on the issue's Edit screen. The goal is to update this field programmatically via a workflow post-function using HAPI, preventing users from manually editing it.
Here's the scenario:
I have a custom field, "Approval status".
This field is not added to the Edit screen for any issue types. This is by design, as I don’t want this field to be updated by users.
I'm using a ScriptRunner script in a workflow post-function to set the value of "Approval status" to "Pending".
The problem is that the ScriptRunner script is failing to update the field. It seems ScriptRunner respects the screen configuration, even though I want to override it in this specific script.
Here's the HAPI code I'm using:
def currentIssue = Issues.getByKey(issue.key as String)
currentIssue.update {
setCustomFieldValue('Approval status', 'Pending')
}
According to the ScriptRunner documentation, there is a mention of "overrideScreenSecurity=true” as a query parameter to allow editing fields that are not on the screen, but that's a PUT requests to the API and I would like to keep it clean, just using HAPI.
Has anyone encountered this issue before? Is there a workaround or a different approach to update a field that's not on the Edit screen using ScriptRunner in a workflow post-function?
Thanks.
Hi @József Porohnavec
this has been asked not long ago and this answer explains how to use it:
https://community.atlassian.com/forums/App-Central-questions/Re-How-do-I-use-setSkipScreenCheck-in-ScriptRunner-cloud/qaq-p/2979051/comment-id/18554#M18554
I hope that helps!
Greetings
Philipp
Thanks for sending me this; the search did not surface it. Exactly what I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.