• 18
    • 16
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      At this time the only way to clear a field resolution would be by adding a post-function in a workflow that does that as referred on the following article:

      Nowadays, we can edit the resolution via REST API but we can't clear its value. It would be nice to have the option to clear the value via REST API.

      Suggestion

      "fields": {
          "resolution": { "name": "" }
      }
      

      Or even by simply setting as null.

      "fields": {
           "resolution": null
      }
      

            [JRACLOUD-75100] Clear Resolution value via REST API

            Olivier T added a comment -

            +1 !!
            It would save me so much time & make the system reliable 

            Olivier T added a comment - +1 !! It would save me so much time & make the system reliable 

            Andrei Safonov added a comment - - edited

            There is a subtle difference how you set and how you clear resolution via API. REST API tells you:

            "resolution": "Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown."

            It took me week to come up with the line, in all other cases, you will get what is above you.

            def resolutionMap = [
                'new': null,
                'to do': null,
                'reopened': null,
                'resolved': 'Done',
                'rejected': 'Rejected']
            
            def issueStatus = ''
            def getIssue = get("/rest/api/2/issue/${issueKey}")
                    .header('Content-Type', 'application/json')
                    .queryString('fields','status')
                    .asObject(Map)
            
            issueStatus = getIssue.body.fields['status']
            
            def resolution = resolutionMap[issueStatus] ? ([name: resolutionMap[issueStatus]]) : null
                
            def updateIssue = put("/rest/api/3/issue/${issueKey}")
                .queryString("overrideScreenSecurity", Boolean.TRUE)
                .header('Content-Type', 'application/json')
                .body([
                    fields: [
                        resolution: resolution
                    ]
                ])
                .asString()
            

            Andrei Safonov added a comment - - edited There is a subtle difference how you set and how you clear resolution via API. REST API tells you: "resolution" : "Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown." It took me week to come up with the line, in all other cases, you will get what is above you. def resolutionMap = [ ' new ' : null , 'to do ' : null , 'reopened' : null , 'resolved' : 'Done' , 'rejected' : 'Rejected' ] def issueStatus = '' def getIssue = get( "/ rest /api/2/issue/${issueKey}" ) .header( 'Content-Type' , 'application/json' ) .queryString( 'fields' , 'status' ) .asObject(Map) issueStatus = getIssue.body.fields[ 'status' ] def resolution = resolutionMap[issueStatus] ? ([name: resolutionMap[issueStatus]]) : null def updateIssue = put( "/ rest /api/3/issue/${issueKey}" ) .queryString( "overrideScreenSecurity" , Boolean .TRUE) .header( 'Content-Type' , 'application/json' ) .body([ fields: [ resolution: resolution ] ]) .asString()

            @Romano Sommer @Cory Beaudoin 

            I'm not sure which request to do with the payload :

             

            { "update": { "resolution": [{"set":""} ]}} 

            Are you using transition REST API ? Or other endpoint or other method?

             

            PRINCE Vincent added a comment - @Romano Sommer @Cory Beaudoin  I'm not sure which request to do with the payload :   { "update" : { "resolution" : [{ "set" :""} ]}}  Are you using transition REST API ? Or other endpoint or other method?  

            Can confirm the following also works for us on Jira Cloud (https://jira.atlassian.com/browse/JRACLOUD-75100?focusedId=3282951&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3282951)

             

            {
                "update": {
                    "resolution": [
                       {                 "set":""             }        ]
                }
            } 

             

            The two suggestions in the Description field on this ticket never worked for us; kept getting "Error while parsing additional fields. Not valid JSON."

            Cory Beaudoin added a comment - Can confirm the following also works for us on Jira Cloud ( https://jira.atlassian.com/browse/JRACLOUD-75100?focusedId=3282951&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3282951 )   {     "update" : {         "resolution" : [            {                 "set" :""             }        ]     } }   The two suggestions in the Description field on this ticket never worked for us; kept getting "Error while parsing additional fields. Not valid JSON."

            +1

            Joshua Dano added a comment - +1

            +1

            Tiansu Yu added a comment - - edited

            Please consider increase the severity of this issue. Our workflow requires us to fill in the "resolution" field, this blocks us from closing tickets automatically via REST API / python sdk. 

            Tiansu Yu added a comment - - edited Please consider increase the severity of this issue. Our workflow requires us to fill in the "resolution" field, this blocks us from closing tickets automatically via REST API / python sdk. 

            {
                "update": {
                    "resolution": [
                       

            {                 "set":""             }

                    ]
                }
            }

            This json worked for us in a team-managed business project. 

            Romano Sommer added a comment - {     "update": {         "resolution": [             {                 "set":""             }         ]     } } This json worked for us in a team-managed business project. 

            +1

            +1

            Robert Marten added a comment - +1

              Unassigned Unassigned
              tbehm@atlassian.com Thiago Behm.
              Votes:
              96 Vote for this issue
              Watchers:
              52 Start watching this issue

                Created:
                Updated: