Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use setSkipScreenCheck in ScriptRunner cloud

Kevin Bouman
Contributor
March 19, 2025

I have a listener that needs to update a field. Using example scripts from ScriptRunner, I was able to get the script to update the field as long as the field was on the screen. However once I take the field off the screen, It doesn't update and I get the below in the listener logs.

 

It says that I can use "setSkipScreenCheck" to enable the field to be updated even if it is associated with a different context. Afte a lot of searching I am not sure how to do this in cloud. There are lots of examples on how to do it for DC/Server. 

 

How do I implement this in cloud? 

 

2025-03-19 17:12:14.553 ERROR - No custom field with the name 'Agile Team' is associated with this issue context, you can use setSkipScreenCheck if your custom field is associated to a different issue context
2025-03-19 17:12:14.557 ERROR - Class: com.adaptavist.sr.cloud.events.WebhookExecution, Config: null

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
kyona
Contributor
March 21, 2025

Hi @Kevin Bouman ,

use "setSkipScreenCheck" inside of HAPI issue update block, like this:

def eventIssue = Issues.getByKey(issue.key as String)
eventIssue.update {
setSkipScreenCheck(true)
setCustomFieldValue("Agile Team", "Team value")
}

I have figured out this right now by trying it...

Regards,

kyona

Kevin Bouman
Contributor
March 24, 2025

Thanks @kyona that worked like a charm. I was putting it in the wrong place. It always seems to be easier than I think it is.

József Porohnavec
Contributor
April 24, 2025

Hi @kyona

Thanks for the example. I have the same issue (a field is not present on the edit screen, so users can't update it), but I get different results.

I added the setSkipScreenCheck(true) to my straightforward custom field update:

 

def currentIssue = Issues.getByKey(issue.key as String)
currentIssue.update {
        setSkipScreenCheck(true)
        setCustomFieldValue("Approval status", "Pending")
}

But I get the error as if ScriptRunner seems to completely disregard it.

2025-04-24 13:21:45.392 INFO - GET /rest/api/2/issue/DFCM-6705?expand=transitions%2Cnames%2Cschema asString Request Duration: 840ms
2025-04-24 13:21:46.234 INFO - GET /rest/api/2/issue/DFCM-6705/editmeta?expand=projects.issuetypes.fields&overrideScreenSecurity=false asString Request Duration: 319ms
2025-04-24 13:21:46.275 ERROR - No custom field with the name 'Approval status' is associated with this issue context, you can use setSkipScreenCheck if your custom field is associated to a different issue context
2025-04-24 13:21:46.279 ERROR - Class: com.adaptavist.sr.cloud.workflow.UpdateIssue, Config: [className:com.adaptavist.sr.cloud.workflow.UpdateIssue, uuid:09be29bd-a908-4585-88f4-16621cd66878, enabled:true, executionUser:ADD_ON, condition:, description:Set "Approval status" to "Pending"., additionalCode:def currentIssue = Issues.getByKey(issue.key as String)

currentIssue.update {
        setCustomFieldValue('Approval status', 'Pending')
},

 It even suggests using setSkipScreenCheck.

Any ideas?

Thanks.

0 votes
Philipp Sendek
Community Champion
March 21, 2025

Hi @Kevin Bouman

as the documentation doesn't bring up anything useful nor a hint on the flag that the error message stated, I would suggest to either create a Support Ticket with Atlassian, Script Runner (Adaptavist) or both. Hopefully they'll have an idea how to bypass that blockage.

I also searched through my Script Runner Cloud repository and didn't find anything for both of those keywords. I assume if I ran into the issue, I simply added the fields to the screen so that my script can edit those.

I hope they'll be able to provide a solution and I'd appreciate it if you could share it here for anyone who'll run into this issue in the future.

Greetings
Philipp

0 votes
Philipp Sendek
Community Champion
March 19, 2025

HI @Kevin Bouman ,

I can also only find documentation for Data Center / Server on this one. There is something similar in Cloud though, but the documentation states that it can only be used by Connect or Forge Apps.
But you can try it anyway:
In the put("/rest/api/3/issue/$issueKey") method you can add an "?overrideScreenSecurity" to the URL.
If that doesn't work, you can follow the instructions of the error message and use "?setSkipScreenCheck" instead, maybe it does work. :-)

If neither works, you could still consider rebuilding the desired mechanism using Jira Automations. I've used this pretty often to perform things that were previously only possible with Script Runner.

I hope this helps.

Greetings
Philipp

Kevin Bouman
Contributor
March 20, 2025

@Philipp Sendek Thanks for commenting. I have tried to implement the setSkipScreenCheck and the editor tells me there is an error in the code. 

I have looked into the Jira automation and while it is possible, it would be crazy long and this just seemed like a quicker solution. I also have some very complicated scripts that I need to convert to cloud and I am fairly certain that this screen check barrier will become an issue. 

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events