This example illustrates a Post-job scriptlet that will send email to the members of the role specified in the scriptlet call.
Astoria provides a review sequence scriptlet named sendEmailToRoleGroup that can be specified in a Task Sequence document Post-job Scriptlet field for a job transition.
def sendSomerEmailToRole(database, moduleH, job, object, currentStatus, nextStatus, isPre, roleName, subjectKey, bodyKey):
objectFlavor = object.GetFlavor(database)
if "dita_map_bookmap" != objectFlavor:
return
starScriptlets.sendEmailToRoleGroup(database, moduleH, job, object, currentStatus, nextStatus, isPre, roleName, subjectKey, bodyKey)
#######################################################################################################################
#
# job review scriptlet registration
#
#######################################################################################################################
registration.registerTaskSequenceScriptlet(sendSomeEmailToRole)
Here is an example of the entry in the Post-job Scriptlet field of a Task Sequence document for the job transition:
sendSomeEmailToRole("Reviewer", "testSubject", "testBody") #Reviewer is the name of the Role whose active members should receive the email
Type | Value |
---|---|
job Id | 0 |
ticket name | 1 |
ticket view URL | 2 |
ticket flavor | 3 |
due date | 4 |
reference name | 5 |
reference view URL | 6 |
reference flavor | 7 |
new owner | 8 |
status changer | 9 |
next status | 10 |
comment | 11 |
envelope ticket name | 12 |
envelope ticket view URL | 13 |
envelope ticket remaining count | 14 |
reference type descriptor | 15 |
envelope ticket id | 16 |
list of changed topics | 17 |
list of topics that weren't changed | 18 |