Workflow Toolbox - Set field from regexp-extracted substring of another field

Bryan Berry December 13, 2013

We want to set a field to a datetime from an email received by JIRA. We currently have the contents of the email populating the description field. We have a regular expression to match the desired substring, but I cannot figure out how to extract that substring and populate the target field with it. It seems like everything the Workflow Toolbox does is backwards or only seemingly related to what I'm attempting to accomplish, and the language describing each post-function is difficult to digest or just plain unclear. I'm really hoping I'm just confusing myself with regards to accomplishing this, at it seems like a remarkably easy task; however, neither "Copy a parsed text to a field", "Set a field from a set of rules based on regexp", nor "Regexp renderer" appears to fit the bill.

So the question: How do I set a field to a regex-extracted substring of another field?

1 answer

1 accepted

0 votes
Answer accepted
David Goldstein
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2013

I suggest installing Jamie Echlin's Script Runner and using it for more sophisticated post-function work. If you have some basic programming chops, you'll find yourself using it for lots of things in JIRA and dispensing with most other post-function/etc add-ons.

Here's how to do field regex copies: https://jamieechlin.atlassian.net/wiki/display/GRV/Post+Functions#PostFunctions-Copyonefieldtoanotherusingregexp

Bryan Berry December 13, 2013

Awesome, thank you for the quick response! I'll see if our admins are cool with this.

Suggest an answer

Log in or Sign up to answer