I need to fetch comments in Jira from the comments i need to save the Sinaaps-number

I am saving the comments.In comments i need to save Sinapps number But for some of comments i am getting SinappsNumber.png files i need to ignore them only text Sinapps number i need to consider remaining any extension i need to ignore them.
And i am getting Sinapps number in middle of text.
Any suggestions.

HI @mettudp075

Please provide the text and what you want from that text. It would help us to write the expression to get the sinapps number from text.

Please find the SInapps- 34567 reference number.

The text will change but Sinapps-**** number is same.
Some times I will get image with name Sinapps-67545.png or some other extensions then i need to ignore the number 67545

Hi @mettudp075

Try this

\d+(?=\.txt)

image

I hope it helps!!

Hi Thanks for the info But it’s not a text file plain text comment like:Ginapps-123456 not a file.

Use the regex expression to extract the number.

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(\d+)”)

image

If it is not a text send me the screenshot then we will get better understanding about that

Hope it helps!!

@mettudp075

Try this

> (?<=Ginapps\-)\d+

or

@mettudp075

Try this

Regards

@mettudp075

A more generic one would be relying on hyphen -

System.Text.RegularExpressions.Regex.Match(str,"(?<=-\s*)\d+(?![\d\.])").Value

Cheers

It’s fascinating to see your inquiry about using Trello API to trigger your script when a card is added to a list. This integration can greatly enhance your workflow automation and communication processes.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.