Workflow on cc'd email reply

We have setup youtrack to consume emails on which a special address has been cc'd.
this setup is working fine and we get the back and forth in a threaded format under each issue.

I would like to be able to manipulate the issue based on certain email text content.
(i.e. someone emails the text "Thank you for resolving this issue" in the body of a an email, i would like to close the issue.)

How do i perform the "contains" operation on the email's body text from inside a workflow?
or maybe there is another way.

tia
--
mike
3 comments
Comment actions Permalink
here is my workflow now.
Resolved is a custom state i made. It can be set through the web interface.

when issue.comments.added.isNotEmpty {
 if (comments.added.contains("Thanks for resolving this issue.")) {
   issue.State="Resolved";
 }
}
prettyPrint();
0
Comment actions Permalink
I think you need something like this:
for each comment in comments.added { 
  if (comment.text.contains("Thanks for resolving this issue.", ignoreCase)) { 
   issue.State="Resolved";
  } 
}
prettyPrint();
0
Comment actions Permalink
Thank you. that worked great. for completeness i forgot one thing. it should be, issue.State={Resolved};
since Resolved is a state I created, and issue.State is an Enumeration. not a string.

thanks again. the for each loop and comment test are perfect.
0

Please sign in to leave a comment.