REST API - Defining a Trace in the Request Body
7 min
the following services require you to define/specify a trace in the request body rest api add traces request docid\ niybwusc5pg3rm7sz jpl rest api delete traces request docid\ shpel8izwqzegecy0r1ku rest api move artifact request docid\ odik9tdoaeir5gggg28ms in the request body you must specify the other artifact in the trace relationship (for rest api add traces request docid\ niybwusc5pg3rm7sz jpl and rest api delete traces request docid\ shpel8izwqzegecy0r1ku requests) or the new parent trace (for rest api move artifact request docid\ odik9tdoaeir5gggg28ms ) parameters you must specify a traces element first to contain any individual traces you want to specify by using the trace element here is an example in xml php template \<traces> \<trace> \</trace> \<trace> \</trace> \</traces> the following parameters can be specified within each element you are specifying artifactid the id of the artifact whose trace relationship is being defined subartifactid the id of the sub artifact whose trace relationship is being defined projectid the id of the project of the artifact whose trace relationship is being defined type defines the type of trace the valid values are the following manual only applicable when adding or deleting a trace parent only applicable when moving an artifact direction the direction of the trace the valid values are the following to from the artifact in the uri request to the artifact in the request body from to the artifact in the uri request from the artifact in the request body twoway the artifacts have a bi directional trace issuspect marks the trace as suspect depending on the request, you are adding a trace relationship to, removing a relationship from, or establishing a new child parent relationship with the artifact in the request body in each context, some parameters are mandatory, while others are optional or ignored adding a trace required direction , type (set to manual), one of artifactid or subartifactid (the other is optional) optional projectid and issuspect deleting a trace required type (set to manual), one of artifactid or subartifactid (the other is optional), direction (if the query is using the reconcilewithtwoway parameter, which is set to true) optional projectid ignored issuspect changing a parent trace required type (set to parent), one of artifactid or projectid the artifact in the request body must belong to the same project as the artifact in the uri request ignored all other properties are ignored examples addtrace example here is an example of a request body in xml format \<?xml version="1 0" ?> \<traces xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<trace> \<artifactid>888020\</artifactid> \<direction>to\</direction> \<issuspect>false\</issuspect> \<projectid>847739\</projectid> \<type>manual\</type> \</trace>\</traces> here is an example of a request body in json format \[ { "type" "manual", "projectid" 123456, "artifactid" 123, "issuspect" false }, { "type" "manual", "projectid" 123456, "artifactid" 456, "issuspect" false }, { "type" "manual", "projectid" 789, "artifactid" 789, "subartifactid" 789, "issuspect" false }] delete traces example here is an example of a request body in xml format \<?xml version="1 0" ?> \<traces xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<trace> \<artifactid>843925\</artifactid> \<type>manual\</type> \</trace>\</traces> here is an example of a request body in json format \[ { "type" "manual", "artifactid" 847750 }] changeparenttrace example here is an example of a request body in xml format \<?xml version="1 0" ?> \<traces xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<trace> \<artifactid>999666\</artifactid> \<type>parent\</type> \</trace>\</traces> here is an example of a request body in json format \[ { "type" "parent", "artifactid" 999666 }]