Project

General

Profile

CLOSED - Quick Redmine_custom_workflows script needed - regex replace string in notes

Added by Matthew Paul over 7 years ago

Contact: Matthew Paul -
Type: Plugin
Language: English

This should be a simple one I think but I am useless at Ruby/Rails etc. So, I've spent way too much time trying to get inbound emails with inline screenshots to work properly. I've got redmine_email_images installed but still doesn't work.

HOWEVER, I also have the excellent redmine_custom_workflows installed also. So you can do a before save on an issue, I already created one so that, before a save, the updater is added as a watcher - like this -

# Add authors/updaters to Watchers
#
# Sets: Watcher

# = before_save = #
if subject.present?
    self.add_watcher(User.current) unless watched_by?(User.current)
end

very simple. So, all I want, it something like that, but it should change this -

Testing screenshot
[cid:image001.png@01D2C8EE.7FE213E0]
ok

To this -

Testing screenshot
!image001.png!
ok

Simple right? A regex to just pick up anything with that pattern (which is what is created by inbound MS outlook emails) and just change it to another pattern using the bang syntax. Then I can let the redmine_email_images do the rest because it already works with the bang syntax for png images.

So, let me know how much and how long, I'd like to just get this done. Then release it for the community

Thanks!

EDIT - gave up on this...