[rt-users] Passing date variables as dates from the CLI

Chris Herrmann chris.herrmann at faredge.com.au
Thu Jan 27 22:36:42 EST 2011


Ok, some more things. I think it's an RT bug not a bash problem... actually I think there are two (possibly separate) bugs. Actually I'm not editing the email after having done some more testing, and there is only one problem... but I'll leave the (brief) journey in to show how I got there.

----------------------------

1. If you create any arbitrary variable that contains a date string (in any format... YYYY-MM-DD,  DD-MM-YYYY etc etc) and try to use this with a "<" operator it will return no results, regardless of how you create the variable. For example, I was previously trying to build a date string (which produces a correctly formatted date string for the variable) but this didn't work. So I tried typing 
	enddate=2011-02-01
and this does not work either. If I replace the variable in the rt cli query with the literal values then it works correctly. Have also tried exporting the variables - it appears to make no difference. I also tried other variable names startdate / randomdate / thisnamecannotbereserved etc.

2. If you are using a date variable with the > operator you get a different result - it returns a whole set of data rather than restricting by the date in question.

Actually, the problem is more with variables fullstop...

faredge at sirius:~$ rtqueryqueue=myrtqueue;export rtqueryqueue
faredge at sirius:~$ rt
rt> list "queue = '$rtqueryqueue'"
Query:queue = '$rtqueryqueue'
No matches found
rt>

If I run this by typing the queue name into the cli, it works OK.

So... then I guess the question becomes how do I correctly pass environment variables into the RT CLI so that they're substituted correctly?

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au   



More information about the rt-users mailing list