Set values with HAPI in write protected issues

Christof Hurst March 23, 2024


in preparation of our cloud migration I want to set some labels for post processing. For this I use a script (mainly with Scriptrunner HAPI).

Some of the issues are write protected (by status property). Is there a possibility to set these labels anyway?

Best regards


1 answer

1 accepted

2 votes
Answer accepted
Jan Eelco Hoekstra
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 23, 2024

There are 3 possibilities here:

1. change the status property in a way that  the scriprunner user can write even if the status property would prohibit it for other users.

2. change the status of the issue to a status where it can be written by the script and change it back after setting the label

3. Let the script remove the status property from the workflow, write the label and put the status property back here.

Option 1  will probably mean that you have to review all workflows that are involved
Option 2 will only work if there is a transition out of the current status. if not, the same as 
                option 1 applies.
Option 3 is a quick and dirty solution, but will probably need a lot of scripting because you must first findout which workflow is used and then find the right status property.

I'm not sure if you can do everything with HAPI, or you need some real scripting too...

I hope this helps.

Christof Hurst March 23, 2024

Thanks, there are only a few workflows that are affected so Option 1 is ok. It's more difficult to find out, why the label couldn't be written. E.g.

  • Another required field is missing

But I can handle with this and most things are working with HAPI.

BR and thanks for the quick answer.

Suggest an answer

Log in or Sign up to answer