Automatic State Change/Notification upon Submission

Answered

Good Morning!

I am trying to create a Workflow to have when a ticket is entered in a default state that upon submission it will automatically change the state and notify 2 specific individuals for review.  Unfortunately I am trying to learn the basics of JScript while doing this as no one in my office knows how to code in it.  Any assistance in what I need to do would be appreciated as I am not getting very far in understanding how to set this up.

Thanks!

-KenH

0
5 comments
Official comment

Hello Kenh, sorry for the delay.

If I got your use case correctly, you will need a workflow written like this:

 

rule Default State - Change it and notify 2 people
 
when issue.isReported() && issue.State == {Submitted} {
    issue.State = {Open};
    var projectLeader = project.leader;
    projectLeader.notify("Attention", "Please pay attention to " + getId());
    var creator = issue.reporter;
    creator.notify("Attention", "State of the issue " + getId() + " is changed to Open");
}
 
Please let us know if you have any further questions or if you need help, thank you.
Avatar
Permanently deleted user

I tried entering the information provided above but when I get to the projectLeader.notify section I am getting the attached issue.

 

Thanks!

0
Avatar
Permanently deleted user

I figured out my issue and got the rule working, but my only issue is that I need to email once changed not to update the project leader but 2 specific users who will be reviewing the ticket first.  How can I change this going forward to submit an email to those individual users instead of the project leader?

Thank you so much for your help!

0

KenH, you can use any other user with the .notify method, I've just written you an example.

Please find more information on how to get a user here: https://www.jetbrains.com/help/youtrack/incloud/7.0/Workflow-Language-Fields.html#userFields

0
Avatar
Permanently deleted user

Understood.  Thanks!

0

Please sign in to leave a comment.