How to get the list of Work Items that a specific team member was modifying in the last month
Hi everybody,
I've been looking for a way to get the list of Work Items that a specific team member was modifying in the last month.
My first though was to use a query. But with a query I can only evaluate all Work Items that was last changed by a user. Because the attribute "modified by" only contains the last user who has modified the work item and not all.
I also thought about a feed. But the only way I know to create a feed is first to create a query. And to evaluate for more users I have always to change the query and then get the feed for this specific query.
I also look for reports, but I didn't find a report that exactly match my use case. And I would like to avoid to create my own BIRT report for that use case.
Did anybody already resolve this problem or has an idea how I could solve it?
Thanks and regards
Martin
7 answers
the reportable rest api might work as you can look at the history and search
https://jazz.net/forum/questions/149321/some-questions-about-reportable-rest-api
https://jazz.net/forum/questions/149321/some-questions-about-reportable-rest-api
Comments
it looks like the filter mechanism is pretty sensitive..
this
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem[itemHistory/modifiedBy/name=sam]/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/*%29%29
returns the error
CRRED0135E: Illegal filter. The field 'workitem/itemHistory/modifiedBy/name' may not be used in a filter because it returns multiple values.
this will get you who and when for each change
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/%28name|modified%29%29%29
this
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem[itemHistory/modifiedBy/name=sam]/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/*%29%29
returns the error
CRRED0135E: Illegal filter. The field 'workitem/itemHistory/modifiedBy/name' may not be used in a filter because it returns multiple values.
this will get you who and when for each change
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/%28name|modified%29%29%29
Comments
working from the referenced prior post , this will list off the info on WHO/when/... changed it each time
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/*%29%29
I'm not sure how to use that in the filter
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/%28id|summary|itemId|itemHistory/%28stateId|predecessor|state/name|modified|modifiedBy/*%29%29
I'm not sure how to use that in the filter
If I look in the documentation at "http://open-services.net/pub/Main/ReportingHome/Reportable_Rest_Services_Interfaces-OSLC_Submission.pdf" in chapter "Filtering capability to select specific resources for data generation" I found only following possibilities:
1) Filter Expressions. A sub-set of this functionality is supported, allowing a basic filter to be defined for resources returned. For example, Project/Tasks/Task/[State="Assigned"]
2) General Comparisons - The general comparison operators are =, !=, <, <=, >, and >=.
3) Support for multiple comparisons using “and” and “or”. Grouping expressions using parentheses – ‘(‘ and ‘)’
So I don't see a way to query all work items that contains a specific entry in the history. I see only a way to filter the history to show only specific entries in all work items - but this is something else.
I give an example:
Work Item 1
- Item History
# event=A
# event=C
Work Item 2
- Item History
# event=A
# event=B
Work Item 3
- Item History
# event=B
# event=C
the query workitem/workitem/itemHistory[(/event=A) result
Work Item 1
- Item History
# event=A
Work Item 2
- Item History
# event=A
Work Item 3
- Item History
but i search for is
Work Item 1
- Item History
# event=A
# event=C
Work Item 2
- Item History
# event=A
# event=B
Do anybody know how to write this query?
this moves the filter lower in the tree and works
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/(id|summary|itemId|itemHistory[modifiedBy/name='sam']/(stateId|predecessor|state/name|modified|modifiedBy/(name|modified)))
this also works but still returns the empty workItem nodes
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/itemHistory[modifiedBy/name='bob']/(stateId|predecessor|state/name|modified|modifiedBy/(name|modified))
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/(id|summary|itemId|itemHistory[modifiedBy/name='sam']/(stateId|predecessor|state/name|modified|modifiedBy/(name|modified)))
this also works but still returns the empty workItem nodes
https://localhost:9446/ccm/rpt/repository/workitem?fields=workitem/workItem/itemHistory[modifiedBy/name='bob']/(stateId|predecessor|state/name|modified|modifiedBy/(name|modified))
If i run your query
workitem/workItem/(id|summary|itemHistory[modifiedBy/name=%27WASSER_M%27]/(stateId|predecessor|state/name|modified|modifiedBy/(name|modified)))
Then I got lots of work items i have never changed. But the history Entry is only shown for entries I have modified. But I need only to see work items I have modified.
I understand.. I don't think there is a way to filter out all the other workitems.. (ie end up with an empty set if there are no matches).. based on the rules it seems like it will always include workItem if the filter returns true, and the filter cannot be across set of results (1 or more of n itemHistory entries)
if you use the second filter I posted in that same post you will end up with a lot of minimal nodes when there is no match (my results below), best I've come up with.
<workItem/>
<workItem/>
<workItem/>
<workItem/>
<workItem/>
<workItem/>
</workitem>
run those results thru sed and you will get just the stuff u care about..
curl -k -c $COOKIES "$HOST/jts/authenticated/identity" >/dev/null
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PASSWORD $HOST/jts/authenticated/j_security_check >/dev/null
O=`curl -k -L -b $COOKIES "$HOST/ccm/rpt/repository/workitem?fields=workitem/workItem/itemHistory\[modifiedBy/name='sam'\]/(stateId|predecessor|state/name|modified|modifiedBy/name|modified)"`
# better function, change the sed operator char to : makes the rest more readable.
# use the returned data, not the firefox reduction of same
echo $O | sed 's:<workItem></workItem>::g'
if you use the second filter I posted in that same post you will end up with a lot of minimal nodes when there is no match (my results below), best I've come up with.
<workItem/>
<workItem/>
<workItem/>
<workItem/>
<workItem/>
<workItem/>
</workitem>
run those results thru sed and you will get just the stuff u care about..
curl -k -c $COOKIES "$HOST/jts/authenticated/identity" >/dev/null
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PASSWORD $HOST/jts/authenticated/j_security_check >/dev/null
O=`curl -k -L -b $COOKIES "$HOST/ccm/rpt/repository/workitem?fields=workitem/workItem/itemHistory\[modifiedBy/name='sam'\]/(stateId|predecessor|state/name|modified|modifiedBy/name|modified)"`
# better function, change the sed operator char to : makes the rest more readable.
# use the returned data, not the firefox reduction of same
echo $O | sed 's:<workItem></workItem>::g'