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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
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.