It's all about the answers!

Ask a question

how to copying workitem query from one project area to another?


Nikhil Raut (114) | asked Aug 23 '23, 11:03 a.m.
edited Aug 23 '23, 11:04 a.m.
 I'm facing a challenge while attempting to copy a query from one project area to another within IBM Engineering Lifecycle Management (ELM). I've been using the method of fetching the query from the source project area and then replicating the expression in the target project area. However, this approach seems to be causing unexpected issues.
The problem I'm encountering is that the query I create in the target project area retains references to the source project's UUID within its expression. As a result, when I execute this query in the target project area, I'm getting incorrect results that are associated with the source project.

I'm wondering if anyone else has encountered a similar issue or has insights into why this might be happening. Could it be related to how ELM handles query expressions during the copy process? I'm keen to find a solution to ensure that the copied query works accurately within the target project area.



here is my code,
Expression expression = sourceQueryDescriptor.getExpression();

IQueryDescriptor createQuery = iQueryCommon.createQuery(targetProjectArea,
QueryTypes.WORK_ITEM_QUERY, queryDescriptor.getName() + "_Automated",
expression);

One answer



permanent link
Ralph Schoon (63.3k33646) | answered Aug 24 '23, 1:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Since the Expression is the thing that is composed of terms and conditions that are specific to a project areas process, it is to be expected that this does not work. 


You will have to rebuild the Expression and, while doing it, replace the project area specific data with data specific to the new project/team area. You can look at what the specific stuff is, by just opening a query in the query editor and look at the conditions and how they are composed. 


Comments
Nikhil Raut commented Aug 24 '23, 2:10 a.m.
 What methods or techniques can I utilize to parse these expressions and extract the individual terms while excluding any project-specific references?
 
 I would greatly appreciate any insights, code snippets, or advice you can provide based on your experiences.

Ralph Schoon commented Aug 24 '23, 3:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

https://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ and the related posts are what I have done in the past. I have never tried what you attempt. 

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.