How do I overrideScreenSecurity when setting a field value (Cloud)?

Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2016

When I try to update a field via the issueInput binding what does not exist on any of my screens (by design), i get the following error.  How do i overrideScreenSecurity so that "hidden" fields can be set?

I'm using ScriptRunner for JIRA Cloud.

Thanks!

 

2016-11-21 19:09:28,388 INFO - Serializing object into 'interface java.util.Map'
2016-11-21 19:09:28,390 INFO - PUT /rest/api/2/issue/80258 asObject Request Duration: 326ms
2016-11-21 19:09:28,403 ERROR - assert resp.status == 204
       |    |      |
       |    400    false
       status: 400 -` Bad Request
       body: [errorMessages:[], errors:[customfield_15500:Field 'customfield_15500' cannot be set. It is not on the appropriate screen, or unknown.]]

 

 

1 answer

1 accepted

4 votes
Answer accepted
Jon Mort [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2016

Hi Randy,

This is a deficiency with the Modify Issue post function we hope to have addressed shortly. To work around it use the Run Script function and use the overrideScreenSecurity query param. For example:

def resp = Unirest.put("/rest/api/2/issue/${issue.key}")
        .queryString("overrideScreenSecurity", true)
        .header("Content-Type", "application/json")
        .body(body)

Regards,

Jon

Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2016

Thanks Jon!

Asha Kumari September 12, 2018

I tried the override setting but still getting the same error.

Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2018

@Asha Kumaripost your script

Suggest an answer

Log in or Sign up to answer