API User Stories

Plutora’s API has a number of user stories to keep in mind.

The API equivalent of grid column filter for Releases, Changes, TECRs, and TEBRs is /filter with the parameter searchFilters. 

General Rules for Requests “POST [entity]/filter” and “POST [entity]/search”

Plutora API allows the following filter requests to be executed:

  • POST TEBRs/filter.
  • POST Changes/filter.
  • POST Releases/filter.
  • POST TECRs/filter.

Plutora Test API allows the following search requests to be executed:

  • POST Categorysettings/search.
  • POST Defects/search.
  • POST Defects/BulkUpdateSearch.
  • POST Requirement/search.
  • POST Requirement/BulkUpdateSearch.
  • POST Testcase/search.
  • POST Testcase/SearchWithExecutionSummary.
  • POST Testcase/BulkUpdateSearch.
  • POST Testplan/search.

All the above requests allow the following operators to be used:

  • Equals.
  • NotEquals.
  • Contains (not applicable for date, date time, or GUID values).
  • NotContains (not applicable for date, date time, or GUID values).
  • LessThan.
  • LessOrEqual.
  • GreaterOrEqual.
  • GreaterThan.
  • IsWithin (also allows multiple values to be separated by commas).
  • NotWithin.

Filters do not work on custom fields, only main entity fields.

The following is a general request template for Releases, Changes, TECRs, and TEBRs. The property and value will need to be inherent to the entity.

{
  "searchFilters": [
    {
      
      "property": "string",
      "direction": "ASC",
      "value": "string",
      "operator": "Equals"
    }
  ],
  "recordsPerPage": 0,
  "pageNum": 0
}

 

User Story: Retrieve Changes or Requirements which have the Status “Testing” or “Review”

Retrieve multiple values by using the operator IsWithin and by separating the multiple values with commas.

Filter: POST Changes/filter or POST Requirements/search.

Request body:

{
    "searchFilters": [
    {
      "property": "Status",
      "direction": "ASC",
      "value": "Testing,Review",
      "operator": "IsWithin"
    }
  ]
}

Now retrieve the same data showing page 3 of the results with 10 records per page. (Note that attempting to retrieve the page beyond the maximum one with data will return a blank response.)

{
	"PageNum":3,
	"RecordsPerPage":10,
	"searchFilters": [
    {
      "property": "Status",
      "direction": "ASC",
      "value": "Testing,Review",
      "operator": "Equals"
    }
  ]
}

User Story: Retrieve Changes that have “ABC” in the name

Request body:

{

  "searchFilters": [

    {

      "Property": "name",

      "Direction": "ASC",

      "Value": "ABC",

      "Operator": "Contains"

    }

  ]

}

User Story: Retrieve the Changes that were last modified by “John Smith”

Request body:

{

  "searchFilters": [

    {

      "Property": "lastModifiedBy",

      "Direction": "ASC",

      "Value": "John Smith",

      "Operator": "Contains"

    }

  ]

}

Or:

{

  "searchFilters": [

    {

      "Property": "lastModifiedBy",

      "Direction": "ASC",

      "Value": "John Smith",

      "Operator": "Equals"

    }

  ]

}

Some data cannot be added to an entity at the time the entity is created, but only to an existing entity. For example, Systems, Stakeholders, Phases, and Gates can only be added to existing Releases, not at the time the Release is created.

Entity Add these to existing entities only
Releases Systems, Stakeholders, Phases, and Gates
Phases Activities
Gates Criteria
Systems Stakeholders
Environments Hosts
Hosts and Components Layers (cannot save without a Component)

 

When performing the following actions, you require the following IDs, which can be found at the following locations.

Action ID Required ID Location
Adding a Phase to a Release Phase’s workItemId /workitemnames/phases
Adding a Gate to a Release Gate’s workItemId /workitemnames/gates
Adding an Activity to a Phase Phase’s assigned WorkItemId from the Release /releases/{{releaseId}}/phases
Phase Name’s workItemId  /workitemnames/phases
Adding a Criterion to a Gate Gate assigned WorkItemId  /releases/{{releaseId}}/gates
Gate Name’s workItemId  /workitemnames/gates

 

System customizations settings can be found via the /lookupfields/<type> API calls.  The full list of supported types can be found by hitting the API endpoint: /lookupfields.

Specifically, StackLayer configurations can be found under: /lookupfields/StackLayer.

To create a Layer… you must first create an Environment (to get environmentId) and Host (to get hostId), separately.  You can then create a new layer, associated back to the environmentId and hostId.

POST https://{{API_host}}/layers

{

"ComponentName": "{{ComponentName}}",

"HostID": "{{hostId}}",

"EnvironmentID": "{{environmentId}}",

"StackLayerID": "{{stackLayerId}}",

"Version": "{{value}}"

}

Back to the top arrow

Was this article helpful?

0 found this helpful.