01-11-2017 12:09 PM - edited 01-11-2017 02:58 PM
Can anyone tell how we can populate the custom fields in an issue through Rest API?
1. I created a new custom issue 'CUSTOMISSUE_TEST' with two columns (Name,Host,Status) on GUI.
2. Then I could associate a device with the issue_type_id 'CUSTOMISSUE_TESTInfo' with the API
3. But I am not sure how I can update the custom fields (Name and Host) ? How can I achieve this?
Solved! Go to Solution.
01-11-2017 06:10 PM
01-11-2017 06:13 PM - edited 01-12-2017 07:37 AM
Wait, I see you are talking about the issue data. That's not the same as a custom field. I will take a look tomorrow morning.
01-12-2017 07:59 AM
Ok, this is working for me. First, you have to create the custom issue definition in the GUI:
Then, your IssueTypeID should match the ID you put in there (without the Info/Warning/Error after it); the Severity should be Info/Warning/Error. Essentially, when you create an issue definition via the GUI, it is creating 3 underlying IssueTypeIDs, one for each severity. But this API call has you only use the base type name.
Last, your parameters to this call should include the column names simply as parameters like this:
And the result is:
01-19-2017 01:15 PM
Awesome. You got it. Exactly what I was looking for John. Thanks much.
But how do we figure it out that the API call takes extra arguments like that?
Also can the device_id can take an array ?
<?xml version="1.0" encoding="UTF-8"?>
<message>The action failed because the request was not valid.</message>
01-19-2017 01:36 PM
First question: I consider this an API documentation bug. I have the distinct advantage of being able to look at the code of the API call.
- DeviceID Optional Array of Integer
The internal Network Automation identifier for the device containing this interface.