Workflow to change state if comment contains resolved

I am having problems to create a custom workflow to change the state based on comments. My current issue with the workflow is that the keyword has to be the first word. I would like it to search the entire comment for this keyword. I have tried comments.added.contains("Resolved") but this doesn't work.

Here is my current workflow:

when comments.added.isNotEmpty {
  if (comments.last.author.isInGroup("helpdesk") && comments.added.first.text == "Resolved") {
    State = {Fixed};
  } else if (comments.last.author.isInGroup("helpdesk") {
    State = {In Progress};
  } else {
    State = {Submitted};
  }
}
5 comments
Comment actions Permalink
You have to use comments.added.first.text.contains("Resolved", opts) or comments.added.first.text.eq("Resolved", opts).

Note, the method comments.added.contains(myComment) expects a comment reference as parameter but not a string.
0
Comment actions Permalink
Workflow editor doesn't seem to want to accept comments.added.first.text.contains() after text it doesn't accept contains.
0
Comment actions Permalink
Do you use completion (Ctrl+Space)? Is the method "".contains(args, opts) acceptable?
0
Comment actions Permalink
Ctrl+Space did it. Thanks alot for the help.

Whats if I want is to be Resolved or resolved? Can i make it not case sensitive?
0
Comment actions Permalink
nevermind I figured that out too. For opts, put ignorecase.
0

Please sign in to leave a comment.