Notification to project manager on project expiry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 08:18 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:13 AM - edited 10-30-2023 11:14 AM
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👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 06:42 AM
Thank you very much for your inputs. Can you please share script if possible?
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 07:00 AM
@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, "", "");
}
Anvesh