Programmatic query to represent WI with attribute set to value among multiple values
Wendy Raschke (30●1●11)
| asked Nov 10 '17, 4:07 p.m.
edited Nov 14 '17, 5:23 a.m. by Ralph Schoon (63.1k●3●36●46) I have written code to query for work items containing certain values in specific attributes.
|
Accepted answer
Ralph Schoon (63.1k●3●36●46)
| answered Nov 14 '17, 9:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Nov 14 '17, 9:42 a.m. This code works for me. It basically creates an expression "Priority High" one expression "Priority Medium", then it creates a Term for Priority High or Medium.
IAuditableCommon auditableCommon = (IAuditableCommon) teamRepository .getClientLibrary(IAuditableCommon.class); Wendy Raschke selected this answer as the correct answer
Comments So, after another revision pass of my code, using the above code snippet provided by Ralph as a model to use, the programmatic query now works properly. To re-iterate, problem was not the usage of an internal utility class to get the proper Identifier object representing the enumeration value (or whatever you call it). That remains the same. The key was in creating separate Term objects with Operator.OR that represents that WI can have one of specified values for "Profile/Edition" and any of etc values for "Planned For." Then adding those two Term objects to the Term object created with Operator. AND.
|
2 other answers
Ralph Schoon (63.1k●3●36●46)
| answered Nov 14 '17, 4:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Nov 14 '17, 4:26 a.m. I have explained what I have tried here: https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/
Comments I'm using a custom utility class to get the Identifier, yes, true, but that's it. I don't see how that makes much difference--since I can confirm that when I use only one and any one of expression to add to the Term object, the query works (it returns expected work items having that value for the attribute).
Ralph Schoon
commented Nov 14 '17, 8:48 a.m.
| edited Nov 14 '17, 8:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Didn't say it was off topic. Did say I don't recognize your code. Custom code, so no way to test it without rewriting it.
|
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.