How to create children automatically? Starting point to triggering a process by email
It is not technically possible at this time to trigger a process by email, but you could create all the ingredients to the process failry simply (caution: simplicity may be in the eye of the beholder).
The idea is you could have a ticket rule that generates an email to the queue. Those emails would create tickets. The email would need the following ingredients:
The parent could be identified by a custom token (see this) like @parent_ticket for example that points to the ID. How you get the ID of the parent would be a job of the query -- this would be an on ticket save rule so presumably the ID of the parent would be the ID of the ticket calling the rule.
Here's a sample select query:
Here's what the email body might look like:
Note that no update query is needed.
The idea is you could have a ticket rule that generates an email to the queue. Those emails would create tickets. The email would need the following ingredients:
- They would need to set the owner
- It would need to indentify the parent ticket
The parent could be identified by a custom token (see this) like @parent_ticket for example that points to the ID. How you get the ID of the parent would be a job of the query -- this would be an on ticket save rule so presumably the ID of the parent would be the ID of the ticket calling the rule.
Here's a sample select query:
Select HD_TICKET.ID,
OPROXY.EMAIL QUEUEMAIL,
CHILDREN.TITLE CHILDTITLE,
CHILDREN.PRIORITY,
SPROXY.USER_NAME SUBMITTER
FROM HD_TICKET
JOIN HD_QUEUE Q ON Q.ID=HD_TICKET.HD_QUEUE_ID
JOIN HD_TICKET_CHANGE C ON C.HD_TICKET_ID=HD_TICKET.ID and C.ID= <CHANGE_ID>
JOIN HD_CATEGORY CAT ON CAT.ID=HD_TICKET.HD_CATEGORY_ID
JOIN HD_STATUS S ON S.ID=HD_TICKET.HD_STATUS_ID
JOIN HD_PRIORITY P ON P.ID=HD_TICKET.HD_PRIORITY_ID
JOIN HD_IMPACT I ON I.ID=HD_TICKET.HD_IMPACT_ID
JOIN (
/* set child ticket values */
select 'Child1' TITLE, 'High' PRIORITY UNION ALL
select 'Child2' TITLE, 'Medium' PRIORITY UNION ALL
select 'Child3' TITLE, 'Low' PRIORITY
) CHILDREN
LEFT JOIN HD_TICKET_CHANGE_FIELD F ON
F.HD_TICKET_CHANGE_ID=C.ID and FIELD_CHANGED ='IS_PARENT'
LEFT JOIN USER UO ON UO.ID=HD_TICKET.OWNER_ID
LEFT JOIN USER US ON US.ID=HD_TICKET.SUBMITTER_ID
LEFT JOIN USER UA ON UA.ID=HD_TICKET.APPROVER_ID
LEFT JOIN USER UU ON UU.ID=C.USER_ID
LEFT JOIN MACHINE M ON M.ID=HD_TICKET.MACHINE_ID
/* verify that submitter is a valid submitter*/
LEFT JOIN HD_QUEUE_SUBMITTER_LABEL_JT SLJ ON Q.ID=SLJ.HD_QUEUE_ID
LEFT JOIN LABEL SL ON SL.ID=SLJ.LABEL_ID
LEFT JOIN USER_LABEL_JT UL ON UL.LABEL_ID=SL.ID
LEFT JOIN USER SPROXY ON SPROXY.ID=UL.USER_ID
/* verify that owner is a valid owner */
LEFT JOIN HD_QUEUE_OWNER_LABEL_JT OLJ ON Q.ID=OLJ.HD_QUEUE_ID
LEFT JOIN LABEL OL ON OL.ID=OLJ.LABEL_ID
LEFT JOIN USER_LABEL_JT UL2 ON UL2.LABEL_ID=OL.ID
LEFT JOIN USER OPROXY ON OPROXY.ID=UL2.USER_ID
WHERE 1=1 and F.AFTER_VALUE=1
and LOCATE(Q.EMAIL_USER,OPROXY.EMAIL)>0 /*there does exist a user to represent the queue*/
and Q.ALT_EMAIL_ADDR<>SPROXY.EMAIL /* the email address of the queue does not match the designated submitter */
and LOCATE(Q.EMAIL_USER,SPROXY.EMAIL)=0 /* the queue user is not the submitter */
and SPROXY.USER_NAME <> OPROXY.USER_NAME /* the queue user is not the submitter*/
and SPROXY.USER_NAME='submitters_user_name' /* change usernameof submitter */
and SL.NAME='submitter_label_name' /* change label that submitter is in */
and OPROXY.USER_NAME='child_owners_user-name' /* change username of proxy owner */
and OL.NAME='newownerlabel' /* change label that proxy owner is in */
Here's what the email body might look like:
@Submitter=$submitter
@Priority=$priority
---------------------
@Parent_Ticket=$id
New child ticket automatically created by rule
Note that no update query is needed.
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
GillySpy
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.