I am attempting to make tickets easier for my team to read. I previously posted about making custom variables and I'm not sure thats the path to go.
The current goal is to take RegEx (which is verified) and use that to pull the required data from incoming tickets. Then taking that data that I need to pull, I want to create a comment with that data.
I've attempted it and when I add the comment its always blank, I have made sure adding comments is working by adding plain text and that shows up.
When attempt to use either regex or even save the regex as a variable, I get an error>
It did work for the first one, but the last 2 even like that are pulling empty. I tested the regex again and its capturing in regex testing, but still showing empty. If you could help 1 more time I'd really appreciate it.
for first one:
Log Source Device Name : O365
Source IP : xxx.xxx.xxx.xxx
Source User : someone[.]random@regex[.]com
Alert ID : INSIGHT-81
Alert Date : 2024-01-19 12:39:28
Action : File Downloads
Count : 697
For the second one this is what it is looking for.
Portal - Ticket: 0002334
Hi @Jay - I haven't tested, but I believe you need quotes around your regex:
{{issue.description.match("[\s\S]*?(?=Recommendation)")}}
{{issue.description.match("^Log\sSource[\s\S]*?(?=\sCount)")}}
{{issue.description.match("^Portal.+")}}
Ok - I just played with the first one and it looks like you also need to encapsulate the regex in parantheses:
{{issue.description.match("([\s\S]*?(?=Recommendation))")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mark Segall
It wouldn't let me reply, I have edited and added my reply to the bottom of the orriginal post, if you have a moment,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These are working for me in my testing:
{{issue.description.match("(^Log\sSource[\s\S]*?(?=\sCount))")}}
{{issue.description.match("(^Portal.+)")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting...still comes back as "empty" on mine...I guess I'll keep poking it because clearly it is an issue on my side if its working for you. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note for each of those last two, the regex requires the respective "Log Source" and "Portal" to be on the first line. I'm not sure if that's your intent. If it is, it worked for me in my testing and I literally copy/pasted the smart values from my environment after confirmed test.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh I wonder if thats the issue...in Regex101 it can grab it from anywhere in the big email, it sounds like that isn't working in Jira. Not sure if thats a Jira issue or Regex ;/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I played around with it a little further and was able to make those last two work like this:
{{issue.description.match("((?i)Log\sSource[\s\S]*?(?=\sCount))")}}
{{issue.description.match("((?i)Portal.+)")}}
You may want to put it through more rigorous testing, but my tests returned desired results.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.