I am trying to integrate my timesheets app with Fogbugz by using a text pattern in the time entry’s notes to indicate that work was done on a case.
Scenario A:
If work was done on case#123, the note would be:
[123] Rewrote javascript code.
Desired output: Case: 123 Note: Rewrote javascript code.
Scenario B:
If work was not related to a case, the note would be:
Rewrote javascript code.
Desired output: Case: Null Note: Rewrote javascript code.
To parse the string, I’m using Pentaho Data Integration’s Regex Evaluation transformation, but I think the regex would probably be the same regardless of the tool in question.
This is the code that I’m using:
(\[(.*)\])(.*)
For Scenario A, I get:
Ignorable field: [123]
Case: 123
Note: Rewrote javascript code.
Scenario B, I get:
Ignorable field: null
Case: Null
Note: Null
Now to the question (finally!) – is there a way for me to get the note portion to show up if there is no “[##]” pattern showing up?
You may want to try this: