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,
here is my code,
Expression expression = sourceQueryDescriptor.getExpression();
IQueryDescriptor createQuery = iQueryCommon.createQuery(targetProjectArea,
QueryTypes.WORK_ITEM_QUERY, queryDescriptor.getName() + "_Automated",
expression);
One answer
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
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.