Forum Discussion

EJ256's avatar
EJ256
Occasional Contributor
3 years ago

JSON API command to update Participant custom fields

Is there is a way to automate assigning in my case different disciplines (quality, safety, test, etc.) for participants for a single review? I have my JSON API commands working to create a review and add a list of participants to the review, but I'm looking to also automate adding their disciplines. Example below of the discipline filed i would like to update 

 

 

10 Replies

  • EJ256's avatar
    EJ256
    Occasional Contributor

    Mods/Smartbear employees? Anybody able to provide an answer? Support would be appreciated.

  • Use ReviewService.updateAssignments

     

    {"command" : "ReviewService.updateAssignments",

    "args":{"reviewId":"00001",

    "assignments": [
    {"user":"user1", "role":"MODERATOR"},
    {"user":"user2", "role":"REVIEWER"}

    ]}

    }

    • EJ256's avatar
      EJ256
      Occasional Contributor

      That assigns the roles, not the custom field in my template

    • Igor_Klimov's avatar
      Igor_Klimov
      SmartBear Alumni (Retired)

      Hello,

      Thanks for contacting us.

      You can use the following API call to set the participant custom field value for the user:

      [{"command":"SessionService.authenticate","args":{"login":"reviewer","ticket":"731ec82736efff4ba6ef5aeb123ea60f"}},{"command":"ReviewService.editReview","args":{"participantCustomFields":[{"name":"Discipline","value":["Management"]}],"reviewId":18}}].

      In this example, I'm setting the Discipline participant custom field to Management for the user whose login name is reviewer in review 18.

      Note, that you need to be logged in under the user to be able to modify their participant custom field value. 

      For more information, please refer to this documentation section: https://support.smartbear.com/collaborator/docs/custom-integrations/json-api/index.html 

      and the ReviewService interface at <your_server_address>/javadoc/jsonapi/.

       

      • EJ256's avatar
        EJ256
        Occasional Contributor

        "Note, that you need to be logged in under the user to be able to modify their participant custom field value." 

         

        So are you not able to automate each participants Discipline when adding them to a review? You can only modify the logged in user? Is there not a way to pass the user ID as an argument whose Discipline field you want to modify? Why would it default the update to the logged in user?