Error Code: 1142. UPDATE command denied to user 'R1'@'sagarwal0512.tns.org' for table 'HD_TICKET' 0.000 sec
I have created a custom rule to assign Due Date of the ticket based on the Priority Level (High/Normal/Low). Select Query is working fine and returns the ticket whose DUEDATE is BLANK. But Update Query throws an error. Below is the Update Query for the ticket:
UPDATE HD_TICKET T JOIN HD_PRIORITY P ON P.ID=T.HD_PRIORITY_ID set T.DUE_DATE= case when P.NAME='High' then DATE_ADD(T.CREATED, INTERVAL 4 HOUR) END, T.DUE_DATE= case when P.NAME='Normal' then DATE_ADD(T.CREATED, INTERVAL 8 HOUR) END, T.DUE_DATE= case when P.NAME='Low' then DATE_ADD(T.CREATED, INTERVAL 36 HOUR) END WHERE T.ID in (<TICKET_IDS>)
Answers (1)
Your query looks fine as far as I can tell and based on the error I would agree that the issue appears to be permissions related.
If you go into Service Desk > Users, note what is listed as R1's Role. From there, if you go to Service Desk > Roles, what access does R1's role have? I'm assuming the role would need Write access to Service Desk > Configuration and possibly also Service Desk > Tickets in order for the update query to apply successfully. If that looks OK, it's also conceivable that ticket rules using update queries might require an admin role (that's what I use), but I don't know this for certain. Support should be able to advise on this if no one else here knows.
John