Query Discussions and their artifacts
search cancel

Query Discussions and their artifacts

book

Article ID: 57581

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

How do I query discussions and their artifacts?

Resolution

Discussion attribute on Artifact is a collection of ConversationPost objects.

Web Services API interactive documentation allows to test queries without the overhead of making a custom grid or writing a custom javascript code.
Below are two examples of queries ran directly in WS API document.

Example 1: query by Discussion.Text in WS API

(Discussion.Text contains "xyz")

The equivalent endpoint URL can be pasted in the browser after replacing <WORKSPACE_OID> with the valid ObjectID of the user's workspace:

https://rally1.rallydev.com/slm/webservice/v2.0/artifact?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/<WORKSPACE_OID>&query=(Discussion.Text contains "xyz")
?

Example 2: query by Discussion.CreationDate in WS API

(Discussion.CreationDate > 2014-05-01)

A query by CreationDate will also work.

The equivalent endpoint URL can be pasted in the browser after replacing <WORKSPACE_OID> with the valid ObjectID of the user's workspace:

https://rally1.rallydev.com/slm/webservice/v2.0/artifact?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/<WORKSPACE_OID>&query=(Discussion.CreationDate > 2014-05-01)
 

Example 3:?query by ConversationPost.CreationDate for a specific artifact?in WS API

query=(Artifact = hierarchicalrequirement/<STORY_OID>)

This query returns all 3 conversation posts of a specific artifact:

https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/<WORKSPACE_OID>&query=(Artifact = hierarchicalrequirement/<STORY_OID>)&start=1&pagesize=200&fetch=CreationDate

Notice CreationDate values:


 "QueryResult":{
 "Results":[
 { 
 "_rallyAPIMajor":"2",
 "_rallyAPIMinor":"0",
 "_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost/<OBJECT_OID>",
 "_refObjectUUID":"<OBJECT_UUID>",
 "_objectVersion":"1",
 "CreationDate":"2014-07-20T17:58:06.124Z",
 "_CreatedAt":"5 minutes ago",
 "_type":"ConversationPost"
 },
 { 
 "_rallyAPIMajor":"2",
 "_rallyAPIMinor":"0",
 "_ref:"https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost/<OBJECT_OID>",
 "_refObjectUUID":"<OBJECT_UUID>",
 "_objectVersion":"1",
 "CreationDate":"2014-07-20T17:59:09.032Z",
 "_CreatedAt":"4 minutes ago",
 "_type":"ConversationPost"
 },
 { 
 "_rallyAPIMajor":"2",
 "_rallyAPIMinor":"0",
 "_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost/<OBJECT_OID>",
 "_refObjectUUID":"<OBJECT_UUID>",
 "_objectVersion":"1",
 "CreationDate":"2014-07-20T18:03:08.449Z",
 "_CreatedAt":"just now",
 "_type":"ConversationPost"
 }
 ]
 }
}

The query above can be further narrowed by CreationDate:

query=((Artifact = hierarchicalrequirement/<STORY_OID>) AND (CreationDate >?2014-07-20T18:00:00.000Z))

https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/12352608129&query=((Artifact = /hierarchicalrequirement/<HIERARCHICALREQUIREMENT_OID>) AND (CreationDate > 2014-07-20T18:00:00.000Z))&start=1&pagesize=20

Notice that results are now limited to only one object in comparison to 3 in the previous query.



 "QueryResult":{ 
 "Results":[ 
 { 
 "_rallyAPIMajor":"2",
 "_rallyAPIMinor":"0",
 "_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/conversationpost/<OBJECT_OID>",
 "_refObjectUUID":"<OBJECT_UUID>",
 "_type":"ConversationPost"
 }
 ]
 }
}

Example 4: custom grid

The screenshots below illustrate a custom grid based on UserStory object. Note: ConversationPost option is not availalble on the custom grid's settings page in the Object dropdown.

 

This custom grid have limitations:
- custom grids are limited to 200 records. If a query returns more than 200 records the custom grid will not display all of them.
- it cannot return attribute of objects that are not being queried directly. If the custom grid is based on User Story object a column like ConversationPost.CreationDate is not available.

Example 5: custom app

A sample app that builds a grid of Discussions filtered by creation date (posts created in the last 30 days) with their artifact data is available from this github repo. This app is not a part of CA Agile Central App Catalog and is not formally supported by CA Agile Central.