- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
We are using ServiceNow as an Intake form for Azure DevOps (AzDo) requests. A person submits a request on the Service Portal, an Epic is created, and then immediately sent over to AzDo. Real-time synch is set between ServiceNow and AzDo, so if one is updated, it sends the updates to the other.
The trigger for ServiceNow sending the initial Epic over to AzDo is the population of the Assignment Group field, which is handled/set by a Template on the Record Producer. There is a Business Rule named "Synch Epic with Azure DevOps" (which I believe came with the Azure Spoke) which handles the sending the record over to AzDo. The Business Rule looks like this:
This works well for most of our Record Producers. However, we have 2 which behave a little differently. They want the Record Producers to go through an Approval BEFORE being sent over to AzDo. So for those two, we do NOT have the Template on the Record Producer populating the Assignment Group field. Instead, we have a Flow that creates the Approval, and if Approved, it then populates the Assignment Group field, which in turn triggers the record to go over to AzDo.
So we made a copy of the initial Business Rule to handle those cases and it looks like this:
And it works, in that it waits until the Assignment Group field is populated before sending these Epic records over to AzDo.
However, we are encountering an unexpected issue. For these records (and these records only), if a Comment is made on the AzDo record, it correctly sends it over to ServiceNow, where the Epic record there is updated with that Comment. However, then ServiceNow re-sends that comment it just received from AzDo back to AzDo, so now the Comments appears twice in AzDo, and we are not sure why.
We tried messing with our second Business Rule, trying various combinations of Insert/Update, Before/After, and changing the condition "Approval is Approved" to "Approval Changes to Approved", but none of the combinations worked properly. Either it would not send anything over to AzDo at all, or we would still have this duplication issue if a Comment was made on the AzDo side.
Can anyone spot the flaw in the logic, or have any recommendations on how to adjust our Business Rule so that it does not send the Comments it receives from AzDo back to AzDo?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
What happens if you just use the record producer condition and the assignment group one and leave out the approval completely (as you mentioned: it happens at the same time, so no need for both).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
It feels like the 'update' trigger, is triggered twice. Is it included in the 'regular' trigger as well? Does that just cover all of them and does this exception rule add it for these? You are using a spoke, so I assume it's also running through flow designer? If so, set the reporting on full and check the execution details on this one to see if it's triggered twice.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Perhaps I wasn't clear. I don't think anything is running twice, I think something is running when it should not be. Let me walk you through an example of what is happening.
First, here is an example of the typical, non-special cases (which work just fine):
1. User submits Epic request on Service Portal
2. Upon submission, Record Producer automatically populates Assignment Group field value
3. Record automatically send over to AzDo
4. On AzDo, I open up the record, and manually add a Comment like "Comment #1"
5. AzDo automatically sends comment to ServiceNow Epic (so ServiceNow now has "Comment #1 also)
6. Process ends there
Now, here is what is happening in those 2 Special Cases:
1. User submits Epic request on Service Portal
2. Upon submission, an Approval is created for this Epic
3. Upon approving the Approval, my Flow updates the Assignment Field on the Epic record (it is blank before then)
4. Record automatically sent over to AzDo (due to Assignment Group being set in previous step and my second Business Rule)
5. On AzDo, I open up the record, and manually add a Comment like "Comment #2"
6. AzDo automatically sends Comment to ServiceNow Epic (so ServiceNow now has "Comment #2 also)
7. ServiceNow sends the same Comment ("Comment #2") it just received BACK to AzDo
8. Process ends there
Now "Comment #2" appears in AzDo twice - once because I manually created it there, and once because ServiceNow sent that comment which it received from AzDo back to AzDo.
So the issue is with step 7. I am not sure why ServiceNow sends the Comment it just received from AzDo back to AzDo. I need to figure out how to stop that from happening. I think it may be because of my second Business Rule. I am not sure how to edit it to make it only run once (on the initial population of Assignment Group only), or to tell it not to run on records which it receives from AzDo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You are right. Your BR runs every time, because it only states 'assignment group is not empty, and status is approved'. That is also the case when it's updated by the comment coming in from ADO. You need to update your BR to only trigger when assignment group changes to your group (assuming it doesn't change).
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
As I mentioned in my original post, I already tried something like that, focusing on the Approval field, and trying to change it so that it only runs when the Approval field changes to "Approved", but that did not work. I even tried messing around, changing it from an AFTER Update to a BEFORE Update Business Rule, but it did not fix the issue.
I could try focusing on the Assignment Group field instead, but I suspect the same issues, as both the Approval field and Assignment Group field are updated at the same time.
A general question about Business Rules; if using a "Changes" or "Change To" operation in the criteria, is it better to set it up as a Before Update or After Update Business Rule?
In the meantime, I will play around with it some more, taking into consideration your thoughts and suggestions, and let you know what I find out.