Forum Discussion

vasilenicusor's avatar
vasilenicusor
New Contributor
2 years ago
Solved

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
        }
    }
]

 

 

  • 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.

     

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

     

    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

     

1 Reply

  • 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.

     

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

     

    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