This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to assign an incident to a group rather than to a person through email when making an API call

Hi guys,

I am creating a google form which creates a SAmanage incident when the form submits and using Apps Script to call the SAmanage api. Here is the doc: https://apidoc.samanage.com/#tag/Incident. In the sample payload, there is a property called assignee that takes in an object which only has the property "email". While this is useful, I was wondering how can I assign a ticket to a group rather than a singular person. 

Thanks!

Parents Reply
  • Alright. Thanks for the tip. Here is a code sample of the payload:

      sa_payload = {
        "incident" : {
          "name": itemResponses[0].getResponse(),
          "description":itemResponses[1].getResponse(),
          "assignee":{
            "assignee_id": "id"
          },
          "requester":{
            "email":formResponse.getRespondentEmail()
          },
          "priority":itemResponses[2].getResponse(),
          "category":{
            "name":category
          },
          "subcategory":{
            "name":subcategory
          }
        }
      }
    
      sa_options = {
        'method':'post',
        'contentType': 'application/json',
        'headers': {'X-Samanage-Authorization':'Bearer ' + SA_token},
        'payload' : JSON.stringify(sa_payload)
      }

Children
  • ...

    "assignee": {

      "assignee_id": "id"

    },

    ...

    should be 

    ...

    "assignee_id": "id",

    ...

  • Oh I did not see that in the API documentation. I will try it out and let you know how it goes!

  • Alright. I got it to assign to the right team. Thank you so much Mitch!

  • I'm running into this same issue and unable to get it to assign the incident correctly when trying to assign to the id of a group.  What was the resolution on this?  I can assign with an email just fine, but neither "id" nor "assignee_id" seems to work.  I've tried about every variation I can think of.  The comment above advises to add a comma after the id, but that is actually malformatted json as there isn't an attribute that follows with the "assignee" section, so I wasn't sure if there was a different solution you found?

  • And of course as soon as I post that I realize what Mitch was saying - there isn't an assignee section in this case, you just use assignee_id at the level that you'd normally use the section of assignee.  Which is odd because that's completely different than assigning to an email, in which case you DO nest the email in the assignee section (this is how the API documentation reads, and there is no mention of using this different structure to assign by assignee_id.

    So once I took out the entire assignee section, and replaced it with the single assignee_id attribute, then it worked.  Sorry I didn't notice that 30 seconds BEFORE I posted that.  :-)