Get my new user stories for a release

This flow demonstrates how to get a list of the new user stories assigned to you for a specific release.

Note: releases are a technical preview. Until made public, send an HPECLIENTTYPE header with the value: HPE_REST_API_TECH_PREVIEW in your requests.

Areas: My work, Backlog, Releases

Entity relationship diagram

We need to access the following entities for this flow, and understand the relationships between these entities.

Entity Relationships in this flow Description of relationship Reference fields
Story User Each story can be assigned to a user. In this flow, that user is you. owner
Phase Each story has a phase (status). In this flow, we are interested new stories. phase
Release Each story can be assigned to a release. release

Back to top

Flow

Let's create the REST API call step-by-step.

  1. To list all the stories in the workspace:

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/stories

  2. Let's build our query_clause. We are only interested in the new stories that are assigned to me and are associated with a specific release.

    This query has two three sets of criteria: The release, the phase (status), and the owner. We separate each set with a semi-colon (;), which represents the And operator.

    Let's start with the first set of criteria, which will be filtering by release. We use the reference field release and filter the releases using the name field and the * wildcard. This lists any release that starts with 941.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/stories?query="release EQ {name EQ ^941*^}"

    Note the syntax for reference fields: 

    Standard request syntax Syntax for reference fields
    Equal sign (=) EQ operator
    Quotation marks (") Carots (^)
  3. Now let's filter by the phase of the story. We only want those stories that are New.

    This is similar to working with list nodes. We want to compare the story's phase with the logical_name whose value new.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/stories?query="release EQ {name EQ ^941*^};phase EQ {logical_name EQ ^phase.story.new^}"

  4. The last criteria is to filter by the owner. Assuming my owner ID is 1001, this query will list any story that is new, assigned to a release that starts with 941, and is assigned to me.

    GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/stories?query="release EQ {name EQ ^941*^};phase EQ {logical_name EQ ^phase.story.new^};owner EQ {id EQ 1001}"

The complete REST API call for this flow is: 

GET .../api/shared_spaces/<shared_space_id>/workspaces/1002/stories?query="release EQ {name EQ ^941*^};phase EQ {logical_name EQ ^phase.story.new^};owner EQ {id EQ 1001}"

Back to top

See also: