This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Process Integration/API PUT or POST to add Configuration Item?

The API documentation leads one to believe that it's possible to add configuration items by id to a ticket at creation or by updating, but I can't seem to make it work.

We're working on an inventory clean up and need to generate dozens of tickets over the course of several weeks to track the work. I need to be able to attach the related computers to the tickets. 

I definitely don't want to have to generate each ticket by hand, searching for and selecting each individual computer to relate it to the ticket, when I have CSV files I've generated with all the data required to plug into automated tickets.

I don't care if it's JSON or XML, I'd just like to not do this manually.

Parents
  • API request body to PUT a single asset to an incident via the API or a process integration:

    XML:

    <incident>
    <assets><asset><id>#assetID</id></asset></assets>
    </incident>
    JSON:
    {
    "incident": {
    "assets": {"id": "#assetID"}
    }
    }
    The process integration works just fine if a SW hardware ID is input as a custom field and the {{}} variable used. 
Reply
  • API request body to PUT a single asset to an incident via the API or a process integration:

    XML:

    <incident>
    <assets><asset><id>#assetID</id></asset></assets>
    </incident>
    JSON:
    {
    "incident": {
    "assets": {"id": "#assetID"}
    }
    }
    The process integration works just fine if a SW hardware ID is input as a custom field and the {{}} variable used. 
Children
  • Hey B Johnson, any way you can share a screenshot of what your process integration looks like? Just curious.

  • Sorry, the image insertion function here is terrible. I have a "SW ID" custom input field for the form. Here's the text of what's set:

    ~~~~~~~~~~~~

    Integration*
    HTTP Method
    URL
    https://api.samanage.com/incidents/{{context_id}}
    Retries* 1
    PARAMETERS APPENDED TO URL
    (none)
    ADDITIONAL HEADERS
    Name*
    Content-Type
    Value*
    application/xml
    BODY
    <incident>
    <assets>
    <asset>
    <id>{{SW ID}}</id>
    </asset>
    </assets>
    </incident>
    ~~~~~~~~~

    Hope this helps!

  • I like to use postman to test the APIs. You get a lot better detail on the errors n such. I noticed that you aren't using the x-smanage auth bearer token. Maybe you omitted that for security reasons. But here is what Im passing, obviously mine is blurred out.