SIL How to make some notification when users haven't any task in status category To DO or In Progres

Temur Khalilov
Contributor
February 15, 2023

I want to make schedule (three times a day) notification to email, when users who haven't any issues in status category To Do or In Progress, need to send this list of users to some emails

2 answers

2 accepted

1 vote
Answer accepted
Anna Hryhoruk _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2023

Hello @Temur Khalilov 

I think it`s possible to configure something similar to what you need with SIL and Power Scripts

Your description is not completely clear, so I would assume some facts. You say : " users who haven't any issues in status category To Do or In Progress," does it mean that those users are Assignees of the issues or Reporters? In my below example I will consider that we are talking about the users who are in the assignee role. Also I do not know where you `ll take those particular user lists , which you are interested in.

So the main thing we need is SIL script. Here is one that approximately does what you need: 

string [] users = "username1|username2";
//string [] users = usersInGroups("jira-software-users");
string [] noissuesusers;
for(string u in users) {
number issuesNumber = countIssues("project = projNAME and status in ('To Do', 'In Progress') and assignee ="+"'"+u+"'");
if(issuesNumber == 0) {
//sendEmail( "", "some_email", "", "subject_or_template", "body_or_template","", "", "") ;
noissuesusers = arrayAddElementIfNotExist(noissuesusers, u);
runnerLog("global noissuesusers: "+noissuesusers);
}
}
runnerLog("send email with list of users: "+noissuesusers);
//sendEmail([EmailMessage] or [[from], to, [cc], subject_or_template, body_or_template, [language] [, wildcard_path_array] [, issue_key, regex_array]])

In the first line you can list the usernames that you need to check , also you can select all users from particular group (line 2 example) but if you go this way in the end you would need to convert output uer keys into readable user names. 
Also if you apply send Email in Line 7 , you can send send emails directly to those users one by one (based on your description I don`t think you need it , but just know that you can notify them too, but you would need also to add few lines of code to find dynamically email adress associated with each user)

But if you want to send the list to some static email , it`s enough to have send email in the end of script. I didn`t include sendemail syntax, but you can read about it here https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15487775/sendEmail , it`s for DC but fo cloud it`s quite similar one. https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15483270/SIL+Mail In addition , before using Send Email routine in script you need to configure Mail Sender Option https://appfire.atlassian.net/wiki/spaces/SIL/pages/16523601/Mail+configuration
But here is important difference in cloud: We can send emails only to users who have set this as public in configurations:contact settings.png

Once the script part is done you need to have a way to run it automatically. You said you want to schedule it`s execution. So you need to configure SIL Scheduler : 

scheduler.pnghttps://appfire.atlassian.net/wiki/spaces/PSJ/pages/15480692/SIL+Scheduler - some documentation about it (there may be some differences because it`s also for DC).

Hope this will be enough for you to get the desired results or at least to start working on it.

Anna

Temur Khalilov
Contributor
March 6, 2023

Thank you for your answer, i will try it

0 votes
Answer accepted
Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2023

Hi Temur,

 

This is not possible in jira to send the list of users.

You can run the DB  Query on DB to get the list of user

refer this will help

 

Accept the answer if it helps

 

Thanks,

Sachin

Temur Khalilov
Contributor
February 28, 2023

Hi thanks for answer, but i use Jira Cloud

Suggest an answer

Log in or Sign up to answer