Notification to project manager on project expiry

ankojice
Kilo Contributor

Hello Community,

I have a requirement to trigger notification to project manager to update the Project data if the project is expired.

 

Help me with this requirement!

3 REPLIES 3

AnveshKumar M
Tera Sage
Tera Sage

Hi @ankojice ,

I assume Project expired in the sense of Planned End date is past. With this assumption, follow the steps below.

1. Register an event in event registry, for example ppm.project_expired.notif

 

2. Create a notification which triggers when an event is fired and the event is the one we created in previous step. And compose the subject and body as per your requirement.

 

3. Create a scheduled Job which runs daily at 8 AM (as per your requirement) and in the script you need to query the pm_project table for projects which are in new & work in progress and the planned end date is yesterday. Then iterate through each record returned and fire the event with the record object.

 

You can also do the same using Flow Designer instead of Scheduled job for low code approach.

 

Please mark my answer helpful and accept as solution if it helped👍

Thanks,
Anvesh

Hi @AnveshKumar M 

Thank you very much for your inputs. Can you please share script if possible?

 

Thanks in Advance!

@ankojice You can try this code.

 

Scheduled Job:

var prjGr = new GlideRecord("pm_project");
prjGr.addEncodedQuery("stateIN1,-5,2^end_dateONYesterday@javascript:gs.beginningOfYesterday()@javascript:gs.endOfYesterday()");
prjGr.query();

while(prjGr.next()){
	gs.eventQueue("ppm.project_expired.notif", prjGr, "", "");
}

 

 

Thanks,
Anvesh