REST API - Defining an ALM Job in the Request Body
7 min
when you are making a request to create an alm job, you must define the alm job in the request body two types of jobs can be defined a push to an alm target or a change summary for a push to an alm target initiating a push to an alm target and initiating a change summary are separate alm jobs that are a part of the same overarching action efficiently exporting artifacts to an alm system defining an alm push sets up the export whereas defining a change summary involves choosing conflict resolutions for the export you can only define one alm job in a single request method the alm job must be submitted using the rest api http post method docid\ hsi lzxs8g rx ydudzkg parameters the following parameters must be specified within the almjobparameters element almjobtype identifies the type of alm job the alm job value can either be almexport or changesummary jobparameters if almjobtype equals changesummary , you must specify the changesummaryparameters value in the jobparameters parameter if almjobtype equals almexport , you must specify the almexportparameters value in the jobparameters parameter for more information about the jobparameters element, see the following section jobparameters element to specify property values for your alm job, include the jobparameters element within the almjobparameters element the jobparameters element can contain various parameters, including the following almrootpath identifies the root path of the project folder which is used as a root for the alm push for example enterprise projects/bp air ( change summary jobs only ) almrootpathid this numerically identifies the folder that is used as a root for the alm push although this parameter is optional, we recommend setting the value if you know id of the target folder in qc/alm system ( change summary jobs only ) baselineorreviewid numerically identifies the baseline or review included in the alm job ( required change summary jobs only ) isfirstpush a boolean ( true or false ) that identifies whether this is the first push to alm or not the default value is true ( change summary jobs only ) isimagegenerationrequired a boolean ( true or false ) that allows you to specify whether you want images generated for any graphical artifacts in the export the default value is true ( change summary jobs only ) conflictresolutionrule specifies how you want to resolve any conflicts that could arise when pushing artifacts to the alm system specify the override value if you want any artifacts you are pushing to override identical existing artifacts in the target system specify the keep value if you do not want to override the artifacts in the target system ( required alm export jobs only ) changesummaryjobid numerically identifies the change summary job ( required alm export jobs only ) the following images show how particular jobparameters elements correspond to the alm export dialog within blueprint here is an image of the second screen that appears during an alm export here is an image of the third screen that appears during an alm export examples addalmjob examples here is an example of a request body in xml format php template \<almjobparameters xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<almjobtype>almexport\</almjobtype> \<jobparameters i\ type="almexportparameters"> \<conflictresolutionrule>keep\</conflictresolutionrule> \<changesummaryjobid>1704\</changesummaryjobid> \</jobparameters>\</almjobparameters> here is an example of a request body in json format { "almjobtype" "almexport", "jobparameters" { "type" "almexportparameters", "conflictresolutionrule" "keep", "changesummaryjobid" "1704" }} change summary here is an example of a request body in xml format \<almjobparameters xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<almjobtype>changesummary\</almjobtype> \<jobparameters i\ type="changesummaryparameters"> \<almrootpath>enterprise projects/bp air\</almrootpath> \<almrootpathid>16\</almrootpathid> \<baselineorreviewid>3506300\</baselineorreviewid> \<isfirstpush>true\</isfirstpush> \<isimagegenerationrequired>true\</isimagegenerationrequired> \</jobparameters>\</almjobparameters> here is an example of a request body in json format { "almjobtype" "changesummary", "jobparameters" { "type" "changesummaryparameters", "isimagegenerationrequired" false, "isfirstpush" true, "baselineorreviewid" 3506300, "almrootpathid" 16, "almrootpath" "enterprise projects/bp air" }}