Do you have feedback on our new interface?
Do you have feedback on our new interface? Let us know HERE
Shyam11 Trusted Contributor.
Trusted Contributor.
799 views

AGM API - Query by last_modified

I want to retrieve all the backlog_items in a specific workspace based on the last_modified field. What is the syntax to provide the values in the GET query (GET /api/workspaces/{workspaceID}/backlog_items)

0 Likes
2 Replies
Micro Focus Contributor
Micro Focus Contributor

Re: AGM API - Query by last_modified

You can see an example in the API Help page at:
https://admhelp.microfocus.com/agm/en/Internal/Help/Content/API_Reference/APIGeneral_codesample.htm?Highlight=backlog_items

Here is an example of a method to get backlog items:

/** 
 * Returns a list of all user stories assigned to a given release. Uses the GET REST request 
 * @param token the security token needed for every REST request 
 * @param releaseId the id of the release from which to get all the user stories 
 * @return a list of all user stories of the release 
 * @throws IOException 
 * @throws JSONException 
 * @throws ParseException 
 */
 public ArrayList<UserStoryBacklogItemEntity> getItemsInRelease(AccessToken token,int releaseId) throws IOException, JSONException, ParseException {
     //http(s)://<server>:<port>/agm/api/workspaces/<workspace_id>/backlog_items?query="release_id=<release_id>" 
     String url=String.format("%s/agm/api/workspaces/%d/backlog_items?query=\"release_id=%d\"",SERVER_URL_PREFIX,DEFAULT_WORKSPACE_ID, releaseId); 
     Map<String, String> headers = createHeader(token); 
     RestResponse response = sendRequest(url, HttpMethod.GET, null, headers);
     verifyResult(HttpStatus.SC_OK,response.getStatusCode()); 
     return UserStoryBacklogItemEntity.createListFromJson(response.getData());
 } 
0 Likes
Highlighted
Tanarl
New Member.

Re: AGM API - Query by last_modified

it's so great app

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.