RPE Report with user input to use multiple entries
I hope I can explain.
I have a rpe report that has a user input variable for the work item id from rtc. The field works with just one id but I am needing to put in different ids and or range of ids to pull.
Ex.
User input- 12345, 12346, 12500-12550
And the report would show just those ids.
Using rpe 1.2.1.1 and rtc 4.0.3
Thanks in advace
2 answers
Is there a reason you are having these work item IDs entered as IDs, instead of allowing the users to directly select work items?
It may work with your design to have all the IDs entered in the same box in some consistent format, such as comma separated values. You could then use javascript to parse them into individual values and do whatever it is you're trying to do.
Hi Michael
You can use the below script to split those user inputs separated by a (,).
var str = "12345,12346,12500,"
do
{
var s=str.substring(0,str.search(','));
str=str.substring(str.search(',')+parseInt("1"),str.length);
console.log( "New value of str: "+s)
}
while (str.length!==0);
In RPE you can use RPE variables (external and internal) instead of actual variables in the script. You may have to use an Iteration Element in RPE to implement the above do while loop. The value to the variables can be controlled using assignments and a similar JavaScript like above.
Best Regards
Abish M Zachariah
Comments
thanks for the reply. So i currently have an external variable called
${wi_id}
and when i publish it to RTC as a report resource, i do get the question of the variable. I put in ONE workitem and it returns the work item like it should. Id like to be able to use that script to work with my variable so that the user can input various id's like
12354, 12346, 12340-12380
would i just replace the var str with ${wi_id}?