REST API - Add Traces Request
18 min
api/v1/projects/{projectid}/artifacts/{artifactid}/traces?reconcilewithtwoway={boolean} description adds trace(s) to the artifact you specify you can only add manual traces (that is, a trace manually added by a user) you cannot add parent/child relationships, reuse relationships or other relationships ou can add more than one trace in a single request as long as the artifactid you specify in the request body has a trace relationship with the artifact in the request uri url structure \[blueprint uri]/api/v1/projects/{projectid}/artifacts/{artifactid}/traces projectid the id of the project that contains the artifact you want to add the trace(s) to artifactid the id of the artifact you want add the trace(s) to supported methods post docid\ hsi lzxs8g rx ydudzkg request uri parameters reconcilewithtwoway (optional) indicates how to handle the existence of an inverse trace this parameter can be set to true or false if set to true , and an inverse trace already exists, the request does not return an error; instead, the trace type is set to twoway the default is false if not specified the default is true if the parameter is included in the uri with no given value request body parameters the trace(s) must be included in the body of the request read more about how to specify one or more traces docid 5qd6 fuzdothy7 mrc1t1 in the request body blueprint result codes your response may contain resultcode and message parameters if your request involves changes to blueprint data these parameters provide detailed information about the result of your request 201 (successfully created) 400 (bad request) 421 (trace not manual) only valid trace value is manual 424 (trace artifact not found) artifact for the trace cannot be located 425 (trace cannot be managed) in order to manage a trace, you need to have trace permissions for both traced artifacts and edit permissions for at least one artifact 426 (traced sub artifact does not belong to provided artifact) sub artifact does not belong to the provided artifact 500 (error) a system error has occurred http status codes 200 ok 201 successfully created 206 partial content 400 bad request this error can occur for a variety of reasons at least one uri or request body parameter is invalid, such as one of the filter docid\ sv9gjverxczcgqdn28j7u , traces, offset or limit parameters a required value has not been provided if you are submitting a post docid\ hsi lzxs8g rx ydudzkg or patch docid\ rcjvhrlby6de zgkehxui request and have not added the x http method override parameter to your request header 401 unauthorized the blueprint token is missing, invalid or expired 403 forbidden the applicable permissions are needed for example, this error can occur when an author or collaborate license is needed for access comment permissions are needed on the artifact edit permissions are needed on the change summary job 404 notfound item is not found in the project for example, this error can occur when artifact not found artifact type not found project not found alm target not found change summary job not found user does not have edit permissions for this artifact, project or alm target 409 conflict reason for failure can be found in the response body additional information may also be found in the log 411 length required if the content length header is missing in the request 413 request entity too large if the provided file size is larger than allowed 415 unsupported media type if the provided media type is not of mime multipart content "form data " 416 request range not satisfiable if offset points to a part of a collection that is not available 500 internal server error 501 not implemented examples xml example example 1 successful add trace call from artifact 777001 to 888020 request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/777001/traces request body \<?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> response body \<?xml version="1 0" ?>\<traceaddresults xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<traceaddresult> \<artifactid>888020\</artifactid> \<direction>to\</direction> \<issuspect>false\</issuspect> \<message>trace between 777001 and 888020 added successfully \</message> \<projectid>847739\</projectid> \<resultcode>201\</resultcode> \<type>manual\</type> \</traceaddresult>\</traceaddresults> example 2 failed attempt to add inverse trace from artifact 888020 to 777001 request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/888020/traces request body \<?xml version="1 0" ?> \<traces xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<trace> \<artifactid>777001\</artifactid> \<direction>to\</direction> \<issuspect>false\</issuspect> \<projectid>847739\</projectid> \<type>manual\</type> \</trace>\</traces> response body \<?xml version="1 0" ?>\<traceaddresults xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<traceaddresult> \<artifactid>777001\</artifactid> \<direction>to\</direction> \<issuspect>false\</issuspect> \<message>a trace with the specified artifact/subartifact already exists provided values are project id 847739, artifact id 777001, subartifact id 0\</message> \<projectid>847739\</projectid> \<resultcode>400\</resultcode> \<type>manual\</type> \</traceaddresult>\</traceaddresults> example 3 using the reconcilewithtwoway parameter to handle an existing trace relationship request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/888020/traces?reconcilewithtwoway=true request body \<?xml version="1 0" ?> \<traces xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<trace> \<artifactid>777001\</artifactid> \<direction>to\</direction> \<issuspect>false\</issuspect> \<projectid>847739\</projectid> \<type>manual\</type> \</trace>\</traces> response body \<?xml version="1 0" ?>\<traceaddresults xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<traceaddresult> \<artifactid>777001\</artifactid> \<direction>twoway\</direction> \<issuspect>false\</issuspect> \<message>trace between 777001 and 888020 added successfully \</message> \<projectid>847739\</projectid> \<resultcode>201\</resultcode> \<type>manual\</type> \</traceaddresult>\</traceaddresults> json example example 1 successful add trace call from artifact 777001 to 888020 request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/777001/traces request body \[ { "type" "manual", "projectid" 847739, "artifactid" 888020, "direction" "to", "issuspect" false }] response body \[ { "projectid" 847739, "artifactid" 888020, "direction" "to", "type" "manual", "message" "trace between 777001 and 888020 added successfully ", "resultcode" 201, "issuspect" false }] example 2 failed attempt to add inverse trace from artifact 888020 to 777001 request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/888020/traces request body \[ { "type" "manual", "projectid" 847739, "artifactid" 777001, "direction" "to", "issuspect" false }] response body \[ { "projectid" 847739, "artifactid" 777001, "direction" "to", "type" "manual", "message" "a trace with the specified artifact/subartifact already exists provided values are project id 847739, artifact id 777001, subartifact id 0", "resultcode" 400, "issuspect" false }] example 3 using the reconcilewithtwoway parameter to handle an existing trace relationship request uri https //blueprintcloud com/api/v1/projects/847739/artifacts/888020/traces?reconcilewithtwoway=true request body \[ { "type" "manual", "projectid" 847739, "artifactid" 777001, "direction" "to", "issuspect" false }] response body \[ { "projectid" 847739, "artifactid" 777001, "direction" "twoway", "type" "manual", "message" "trace between 777001 and 888020 added successfully ", "resultcode" 201, "issuspect" false }]