How to notify Project Lead about changing of every issue in project?

I need to notify Project Lead about all changes of any issue in his Project.
So I wrote worflow rule to add Project Lead as a watcher, but Project Lead don`t get any notification.

rule Add_Watcher_ProjectAdmin_permanently 
when issue.updated { 
  issue.applyCommand("add watcher " + project.leader.login); 
}
prettyPrint();

Than I tried to send notification directly like this
rule Notify_ProjectAdmin_about_any_changes 
when issue.updated { 
   project.leader.notify( "notification_string" ); 
}
prettyPrint();

But I didn`t find any way to form notification_string automatically. As I got I need to form custom notification_string for every updates by myself.

How can I notify Project Lead automatically about any issues changes with automatically notification_string generation?
1 comment
Comment actions Permalink
First of all you can subscribe project lead to all changes on the project in a general way. Create a new saved search with the query "#issues", go to the profile > "Filters and Notifications" tab and check all events for it.

Couple words about the workflow. The mуthod project.leader.notify("title", "text"); needs 2 parameters: the letter summary and text.

To track all issue changed you have to leave condition block empty and track particular change inside the workflow:
rule change 
 
when <issue created or updated> { 
  var msg = ""; 
   
  if (Priority.changed) { 
    if (msg.isNotEmpty) { 
      msg = msg + "\n"; 
    } 
     
    msg = msg + "Priority changed from " + Priority.oldValue + " to " + Priority; 
  } 
  if (Type.changed) { 
    if (msg.isNotEmpty) { 
      msg = msg + "\n"; 
    } 
     
    msg = msg + "Type changed from " + Type.oldValue + " to " + Type; 
  } 
   
  for each comment in comments.added { 
    if (msg.isNotEmpty) { 
      msg = msg + "\n"; 
    } 
     
    msg = msg + "Comment added: " + comment.text; 
  } 
   
  project.leader.notify("Issue " + getId() + " has beed changed", msg); 
}
prettyPrint();
0

Please sign in to leave a comment.