Hi,
Is it possible to use PowerScript/ScriptRunner to validate the data when creating/updating a JIRA issue from REST APIs? Instead of using a validator in a transition, I need to validate data when doing a simple update (e.g. update a customfield).
If not possible, is there a way to control the response?
Thank you.
Hello @Kevin Huang
I know this is quite an old question, but maybe other people could also benefit from it.
To my knowledge, Power Scripts does not natively provide a way to validate issue updates at the API level before they are processed. But I want to suggest different way.
Since you cannot block the update at the API level, you can listen to issue updates using SIL Listeners and take corrective action if the data is invalid. You attach sil script to the listener that check field changes using lastIssueChanges()
or getFieldChanges()
, check if the update meets your conditions, and revert it if necessary. If an invalid update is detected, you can reset the field , log the change, or notify the use. This won’t block the REST API request but lets you enforce validation rules by rolling back unwanted changes.
Hope it helps!
Anna
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.