Ask a Question

Unable to add checklist via Java API

SOLVED
vasilenicusor
New Contributor

Unable to add checklist via Java API

Hello, 

I have issues with creating an API request to add / remove checklist from review. Have tried using same from documentation but I get

NullPointerException
Thank you for support

 

 

[
    {
        "command": "SessionService.authenticate",
        "args": {
            "login": "{{collab_dev_admin_user}}",
            "ticket": "{{collab_dev_admin_token}}"
        }
    },
    {
        "command": "ReviewService.addChecklist",
        "args": {
            "reviewId": 123,
            "id": 181
        }
    }
]

 

 

1 REPLY 1
melgage
Staff

Looking at your JSON, the only things you are missing are the " " around the reviewId and your second parameter should be "checklistId".

 

Here's an exmaple of the code snippet I ran on my local server to add checklist #2 to my review #449:

 

[{"command" : "SessionService.authenticate",
   "args" : {
      "login" : "xxxxxxx",
      "ticket" : "xxxxxxxxxxxxxxxxx"
      }
},
{"command" : "ReviewService.addChecklist",
   "args" : {
      "reviewId" : "449",
      "checklistId" : "2"
      }

}]

 

My review before executing this command shows checklistId #1 (Development Checklist) available on the review.

melgage_0-1672950352403.png

 

Executing the JSON detailed above adds the second checklist (#2 - Cross Team Communication) to that same review:

melgage_1-1672950448312.png

 

Please note that the checklists you want to add through the JSON API must be available to the template in use on that particular review.

 

Cheers,

Mel

 

Mel Gage | Solutions Engineer - Collaborator, LoadNinja
e: Mel.Gage@SmartBear.com
cancel
Showing results for 
Search instead for 
Did you mean: