It's all about the answers!

Ask a question

How to get the list of Work Items that a specific team member was modifying in the last month


Martin Wassermann (13864144) | asked Dec 15 '14, 8:47 a.m.
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



permanent link
sam detweiler (12.5k6195201) | answered Dec 15 '14, 8:50 a.m.
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


Comments
Martin Wassermann commented Dec 15 '14, 9:36 a.m. | edited Dec 15 '14, 9:37 a.m.

 Thanks, that's a great feature. But if I use


workitem/workItem[modifiedBy/name=WASSER_M]/(id|summary|itemId|itemHistory/(modifiedBy/name))

I got the same like in the query, only the Work Items where I am the last modifier. If I try

workitem/workItem[itemHistory/(modifiedBy/name=WASSER_M)]/(id|summary|itemId|itemHistory/(modifiedBy/name))

I receive the error message 

Error 500: CRRED0118E: The value itemHistory/(modifiedBy/name=WASSER_M) is not a valid condition.

Do you know how I can set a condition for the item history?


sam detweiler commented Dec 15 '14, 9:46 a.m.

I do not understand the syntax..

you 'should' be able to find every change where you are the changer.


Martin Wassermann commented Dec 15 '14, 9:51 a.m. | edited Dec 15 '14, 9:51 a.m.

 and if I use


workitem/workItem/(id|summary|itemId|itemHistory[modifiedBy/name=WASSER_M]/modifiedBy/name)

I get not work items i have modified. And the history is not part of the output. Therefore I think my syntax is not correct.


Martin Wassermann commented Dec 15 '14, 10:18 a.m.

 and if I try 


workitem/workItem[itemHistory/modifiedBy/name=WASSER_M]/(id|summary|itemId|itemHistory/modifiedBy/name)

I got the error message 

Error 500: CRRED0135E: Illegal filter. The field 'workitem/itemHistory/modifiedBy/name' may not be used in a filter because it returns multiple values.


permanent link
sam detweiler (12.5k6195201) | answered Dec 15 '14, 11:03 a.m.
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

Comments
Martin Wassermann commented Dec 16 '14, 3:27 a.m.

 Yes. Without filter I was able to get the information (the link you told me in the first post was very helpful). But a filter is also necessary because otherwise the query results all items and I have to "search" for the one the user have changed. As mentioned above I have tried the filter on different locations in the request but I was not able to get the result I want. 


Is it really possible to user this filter also for the item History?


permanent link
sam detweiler (12.5k6195201) | answered Dec 15 '14, 10:28 a.m.
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

permanent link
Martin Wassermann (13864144) | answered Dec 16 '14, 7:36 a.m.
 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?

permanent link
sam detweiler (12.5k6195201) | answered Dec 16 '14, 7:48 a.m.
edited Dec 16 '14, 8:10 a.m.
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))

permanent link
Martin Wassermann (13864144) | answered Dec 16 '14, 9:16 a.m.
edited Dec 16 '14, 9:17 a.m.
  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.

<workItem>
<id>2269</id>
<summary>A-Very-Sunny-Afternoon-69</summary>
</workItem>
<workItem>
<id>9097</id>
<summary>A-Very-Sunny-Afternoon-1969</summary>
</workItem>
<workItem>
<id>9098</id>
<summary>A-Very-Sunny-Afternoon-1969</summary>
</workItem>
<workItem>
<id>24703</id>
<summary>Test</summary>
<itemHistory>
<modifiedBy>
<name>WASSER_M</name>
<modified>2014-11-25T10:55:30.883+0100</modified>
</modifiedBy>
<stateId>_B0KFkNnNEeOQwa5Om3srZQ</stateId>
<predecessor>_BzkPsdnNEeOQwa5Om3srZQ</predecessor>
<state>
<name>New</name>
</state>
<modified>2014-05-12T14:00:36.457+0200</modified>
</itemHistory>
<itemHistory>
<modifiedBy>
<name>WASSER_M</name>
<modified>2014-11-25T10:55:30.883+0100</modified>
</modifiedBy>
<stateId>_BwSSMdnNEeOQwa5Om3srZQ</stateId>
<predecessor/>
<state>
<name>New</name>
</state>
<modified>2014-05-12T14:00:36.051+0200</modified>
</itemHistory>
<itemHistory>
<modifiedBy>
<name>WASSER_M</name>
<modified>2014-11-25T10:55:30.883+0100</modified>
</modifiedBy>
<stateId>_BzkPsdnNEeOQwa5Om3srZQ</stateId>
<predecessor>_BwSSMdnNEeOQwa5Om3srZQ</predecessor>
<state>
<name>New</name>
</state>
<modified>2014-05-12T14:00:36.395+0200</modified>
</itemHistory>
</workItem>

permanent link
sam detweiler (12.5k6195201) | answered Dec 16 '14, 9:36 a.m.
edited Dec 16 '14, 3:02 p.m.
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'

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.