trackerService.queryWorkItems and Strings concat.

Description
vinicius.zavam
Posts: 20
Joined: Thu Feb 09, 2012 7:46 am
Location: Aachen, Deutschland
Contact:

trackerService.queryWorkItems and Strings concat.

Postby vinicius.zavam » Thu Feb 09, 2012 8:42 am

gentlemen,
morning.

I'm getting some issues with ALM 3.5.3.20111209-1029 regarding the use of String here; I'm trying to concatenate things to use with $trackerService.queryWorkItems to build and make some smooth interactive queries to do a nice feedback/reporting tool.

the codes below can show you what I just did to try a workaround.
maybe some of you could give me a glue about solving it.

working code

Code: Select all

#set ($UDT = "123")
${UDT}umdoistres

working code

Code: Select all

{parameter:myuser | project=@current | type=user | value=@me}
#set ($MYNAME = $pageParameters.myuser.getId())
${UDT}${MYNAME}

working code output: TSK-001

Code: Select all

#set ($Q = "project.id:playground AND type:task AND (status:open OR status:closed)")
#set ($X = $trackerService.queryWorkItems($Q, "~id"))
#foreach($x in $X)
   <option>$x.getTitle()</option>
#end

working code with no output results

Code: Select all

#set ($PRO = $pageParameters.myproject.getName().toString())
#set ($Q1 = "project.id:${PRO} AND type:task AND (status:open OR status:closed)")
#set ($ABC = $trackerService.queryWorkItems($Q1, "~id"))
#foreach($abc in $ABC)
   <option>$abc.getTitle()</option>
#end

not working code

Code: Select all

#set ($Q2 = "project.id:")
#set ($Q3 = " AND type:task AND (status:open OR status:closed)")
#set ($REALQ = $Q2${PRO}$Q3)
$REALQ


Error in document content.
Error number 4001 in 4: Error while parsing velocity page project/playground/page/Sandbox/VZ Wrapped Exception: Encountered "${" at line 85, column 19. Was expecting one of: … … "-" … "+" … "*" … "/" … "%" … "&&" … "||" … "<" … "<=" … ">" … ">=" … "==" … "!=" … …


very appreciated.
wish you all a nice day.
Vinícius Zavam
profiles.google.com/egypcio

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: trackerService.queryWorkItems and Strings concat.

Postby NickEntin » Fri Feb 10, 2012 10:14 am

Hello,

I hope you can play with this a bit more to find proper approach or to ask on Velocity forums how to formulate these concats better.
From the code it doesn't look like you have problems with Polarion - it's pure Velocity question, or do I miss the point?

in your last code:

Code: Select all

#set ($REALQ = $Q2${PRO}$Q3)


should it not be?

Code: Select all

#set ($REALQ = "$Q2${PRO}$Q3")


Best regards,
Nick

vinicius.zavam
Posts: 20
Joined: Thu Feb 09, 2012 7:46 am
Location: Aachen, Deutschland
Contact:

Re: trackerService.queryWorkItems and Strings concat.

Postby vinicius.zavam » Fri Feb 10, 2012 10:31 am

yes, nick! you are 100% right.
I must admit that it was a dummy/silly question; I figured it out before this post got accepted.

thank you.
['s]
Vinícius Zavam
profiles.google.com/egypcio


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 9 guests