Query Discussions and their artifacts

Document ID : KB000057581
Last Modified Date : 14/02/2018
Show Technical Document Details

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 1111 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/1111&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 1111 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/12352608129&query=(Discussion.CreationDate > 2014-05-01)
?

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

query=(Artifact = hierarchicalrequirement/777)

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/12352608129&query=(Artifact = hierarchicalrequirement/19953860311)&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/20747622341",
??????????? "_refObjectUUID":"3e7a761a-855f-4e56-ba05-b999bb70c9b9",
??????????? "_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/20747622480",
??????????? "_refObjectUUID":"beb02014-0520-4771-bf96-6fa8a3a0898e",
??????????? "_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/20747622867",
??????????? "_refObjectUUID":"81cfd8a6-564e-4358-92bd-4a378cd2f6e4",
??????????? "_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/777) 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/19953860311) 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/20747622867",
??????????? "_refObjectUUID":"81cfd8a6-564e-4358-92bd-4a378cd2f6e4",
??????????? "_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.

User-added image

User-added image

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.


?