Forum Discussion

vasilenicusor's avatar
vasilenicusor
New Contributor
3 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
        }
    }
]

 

 

  • sonya_m's avatar
    sonya_m
    5 years ago

    Thank you Alex!

     

    PrecisionDan , I wasn't able to locate your support ticket. Could you let us know if you figured out the solution to this? Otherwise, I'd encourage you to open one, as Alex suggested. It would be great if you could share the final solution with us here too!

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