Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 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);

0 votes



One answer

Permanent link

 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. 

0 votes

Comments
 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.

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019
× 7,495
× 1,700
× 1,325

Question asked: Aug 23 '23, 11:03 a.m.

Question was seen: 1,317 times

Last updated: Aug 24 '23, 3:17 a.m.

Confirmation Cancel Confirm