1 answer
- 10-1
Hi, I have an example here that should help you We have integrated ZD with SN but when we push Tickets to Zendesk it is losing people date like Requester/Agent and replacing it with my information in the ZD ticket.
The idea is that you only add the User prefix if it's now found:
issue.comments = commentHelper.mergeComments(issue, replica){ comment -> comment.executor = nodeHelper.getUserByEmail(comment.author?.email) if(comment.executor == null){ comment.body = "Comment from servicenow by "+comment.author?.username + "\n:" + comment.body } }
Hope it's helpful.
Juan
- Ziad Qadora
Hi Juan,
I get the same error when use the provided error as the one when using the code below
issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }
Below is the error
com.exalate.api.exception.script.CreateProcessorException: Script error details: Comment could not be created because FORBIDDEN.<Username>, you do not have the permission to comment on this issue.. Error line: IssueLinks.groovy:774 at com.exalate.error.services.ScriptExceptionCategoryService$.wrapAsCreateProcessorException(ScriptExceptionCategoryService.scala:54) at com.exalate.processor.jira.JiraCreateIssueProcessor.createIssue(JiraCreateIssueProcessor.java:162) at com.exalate.replication.request.CreateIssueSyncRequestState.transition(CreateIssueSyncRequestState.java:73) at com.exalate.replication.request.CreateIssueSyncRequestState.transition(CreateIssueSyncRequestState.java:24) at
Regards,
Ziad
- Juan Grases
That means that the user set on the executor doesn't have permission to create comments on that issue. We have seen that Jira API blocks customers to create comments for example. Was the user a customer?
- Ziad Qadora
Hi,
The users in this case are vendors who have no access to the remote system. I'm just trying to see if there is way to resolve the issue on hand.
Regards,
Ziad
- Ziad Qadora
Hi,
Correct, but in this case they are vendors who do not have to the remote system.
Regards,
Ziad
- Ziad Qadora
For what I'm trying to do the user need to exist in the local instance
- Francis Martens (Exalate)
Ziad Qadora
What is the current status. Is Juan's suggestion helping? - Ziad Qadora
I reverted to the default comment sync because the users have to be on both sides in order to use the solution that Juan suggested.
- Francis Martens (Exalate)
OK - got it.
In the cases where the creation failed because the executor was a customer - are you sure that the customer request type was set on the ticket?
Add your comment...
Hi,
I'm trying to sync comments so when the author is present in both system then we do not need to have the sync user info showing by using the below
/*
Sync comments with the original author if the user exists in the local instance
Remove original Comments sync line if you are using this approach
*/
issue.comments = commentHelper.mergeComments(issue, replica){ it.executor = nodeHelper.getUserByEmail(it.author?.email) }
But if the user is not present in the remote system then use
issue.comments = commentHelper.mergeComments(issue, replica)
Is there a way to accomplish this?
Thanks,
Ziad