logo

NJP

Copy Comments to Parent Records with Flow Designer

Import · Jul 13, 2023 · video

[Music] thank you hey everyone it's Justin thank you for watching and welcome to my house that's Justin's house in this video we're continuing my discussion about Azure devops and servicenow Integrations and a special shout out to Jim my colleague who made a point that in my synchronization of stories to Azure devops when there's a comment added in Azure devops it updates the story but it doesn't necessarily it doesn't at all actually update the incident or update the customer service task well in this video I'm going to show you how to do that okay so let's explain what I'm talking about real quick so you can follow along here I've got a story that's being synchronized over to Azure devops someone added a comment here's a comment we're on the case now let me show you Azure devops this is this story right here there is a delay in the impact jobs the longest delay is 540. so someone came in and put in a comment here's a comment we are on the case and it came over to servicenow to the story record notice though that this story record is actually linked to an incident 31 five eight two if I go to that story record let's just search for it here in the global search we'll just hop right over to that result and we'll see in the infinite record the note's not there so whoever is managing the incident or substitute customer service task they wouldn't see that that note got added from Azure devops and I want to show you how to fix that so for now we're going to high Dodge or devops and we're going to go build ourselves a flow in flow designer that's going to handle this for us now the flow in flow designer is going to use a trigger of the journal table or CIS Journal table it's where comments are stored in servicenow so I'm going to call this copy comments from story to parent record for servicenow sprinters right we're going to limit this just to the assignment group just like we did everything else in our previous videos in this series so that's not going to run for groups that are not synchronized to Azure devops I only want it to run when I'm doing this integration with Azure devops now could you do this for other use cases where you to copy comments from Child records to parent records a hundred percent yes you could but for my purposes we don't need to do that let's go ahead and copy the flow name down to that description and I'm waiting for that application to load up there we should be in the global scope for this and as soon as it done it's done I'm going to hit submit there it is as soon as I said submit it popped up I'm not even going to edit that out so we're going to start with our flow here and we're going to add a trigger and that trigger is going to be something is created all right so I'm not going to do created or updated I'm not going to do um those other options there updated daily schedule I just want when that comment gets added for the first time from Azure devops and we're going to pull that from CIS Journal underscore field you'll see what that looks like here in a second CIS underscore Journal underscore field it's going to be a journal entry record now let's go take a look at that table so you can follow along with what I'm doing here if we go to that table by typing this into the navigation menu dot list will take us to the table you'll see that on that table it has the table name it has the element that was added in this case Rook nodes the other one would be additional comments or comments I think the element ID is the sys ID of the asset record and then the value is the comment well we're working with stories let's go to RM unders underscore story if we go to that one we should see that comment we can see it we're we see it we are on the case that's the one we were looking at earlier right let me get off of that there right there we see it we're on the case and we can see the assist ID for that so I need a couple of things when I'm doing that trigger I want to filter on Aaron's story and then after we do that then we're going to do some if Logics to filter it down even more so let's go update the trigger we're going to add a condition and we're going to say that the name is RM underscore story because that was the name in that column for RM story it's name and that's our table name so we're going to filter it there I'm going to hit done and that's all we're going to do there so now this is only going to fire when someone adds a comment on a story record now we're going to say um actually I want to look up that story record so we're going to look up a record and we know it's going to be a story because we're filtering on the story so let's go ahead and pull up the RM underscore Story table and then we're going to filter on that looking for the sysid is the trigger I believe it was element IDs these so this this ID is right there so we'll just go by trigger here journal entry record and element ID so we're making sure that the sys ID is equal to the element ID from that journal entry record and that'll give us the story right so this has the story that we're going to connect to the parent record on and the trigger has the actual comment itself okay following along so now we're going to say if that particular story so we're going to look up the story record and we're going to say if the story record uh what do I want to say here if the story record is assigned to the servicenow sprinters group so let's filter on assignment group and actually I want to filter even more so let's go not the assignment group because then I'd have to look up the assignment group let's go look up record Story Record the assignment group right here and then I'm going to type in their name as servicenow sprinters so now I'm limiting it to it's only going to do what's after this if statement if it was a comment on a story and that story is a time that the service now scriptures group and I'm going to do one more and the parents of that story record so we'll just go down here to parents if you remember in our previous videos we're setting the parent of the story record to the incident or to the customer service task so let's just go to the parent record and let's make sure that task type is an incident so I'm just going to search for incident there we go so now it's only going to fire if it's a sign of the service now sprinters and the parent task is an incident and we know we did customer service tasks before so we have to do the same thing so this will work for both workflows we don't have to make another one for customer service tasks so we'll scroll down here to parent and check that task type is a choice and if you remember from that video it's not customer service task unfortunately it's task is the name of that one so we'll scroll down here to the t's uh s q r s t there I have task and task one of these is going to be the customer service task and one of these is going to be the out of the box task table I'm going to go the S I send underscore customer service task the table name would come before task because ask content 4S so I'm going to bet it's this one we won't know until we actually test it but that's okay so now I've got my conditions and all I want to do now is I want to add a worknote to the parent record so we're going to go to actions we're going to search for work notes all right if you look if it's actually showing up in my recent but if you're on your instance just go down to itsm and there will be add work note it's really simple there you have to select a task the tasks we're going to select is the parent of the story record all right so we're just going to navigate to look up record Story Record and parents so remember that parent record could be an incident it could be a customer service task if we pick that right task table and then the work note I'm going to go ahead and say story comment added colon and then I'm going to select that um trigger and if we look at the trigger the journal entry record I believe it was value was the comment let's go check yep value is the comment there so let's go ahead and select value and so story comment added we make sure the space in there and then it would be the comment there so it'll show up in the actual incident record or the customer service task and uh yeah that's all I need there so I'm going to hit done and we're going to save this and I'm going to be risky and I'm going to go ahead and activate it and we're going to create a new incident together and test all this all the way through so let's activate we'll head back over to service operations workspace here while that's activating and we are going to create a new incident should be done there yeah so that flow is activated successfully we're going to create a new incident and this is going to be demo for YouTube and we'll call this one um copy comments to parent record all right so we could differentiate it from my other demos for the YouTube we'll just put that in the description and the caller will set to Abraham Lincoln if we'll pull up here there he goes and the assignment group uh is going to be servicenow sprinters because that's going to kick off that flow that we already did to create it in Azure devops so let's go ahead and bring Azure devops back here in the background and before I hit save so I got the description short description collar and the assignment group so let's go ahead and save that where's my save button let's scroll down here save and what we're going to want to watch here after this saves is the comments should have everything we need in there so it's gone ahead and done that and I should see a comment come through here that the um the story was created there the story 10032 has been created and assigned to servicenow sprinters um we can actually let's just stay here on this screen let's go back to Azure devops behind my head here we'll go to work items and we should see scroll down and scroll up scroll down and scroll up there it is uh is it there I don't see it yet actually let's let's just go somewhere else and then go back to work items this should be the name of this one should be demo for YouTube is what I'm looking for and I'm not seeing it yet it did create the story record so I know the story was created I've had this problem in Azure devops too where it doesn't show up right away I'm just going to refresh the whole page oh there it is as soon as I hit refresh it showed up at the top above living room temperatures so let's wait for it to no it actually refreshed okay maybe they refreshed it all right so let's open that up there's the demo for YouTube comments to parent record and we'll say um you know someone a developer is actually responding that we're on it so we can say we see this incident and are working on a fix ASAP right so they're making sure they're communicates and everybody knows what's going on the integration itself is going to copy that to the story record but the flow we just made should copy that story comment up to this incident record and we should see that show up right here in the middle I'm just going to bring out my little imitate annotations tool and there it is story comment added we see this incident and are working on the fix ASAP so that's it we actually did that I'm going to go back to flow designer just to show you how that actually executed so you can see and follow that logic through let's open Flow designer here and we're going to go to executions right there we don't need Azure devops anymore there's where it ran and is complete and we can follow step by step the journal entry was created so that is the trigger there and the filter condition was true because it was on the story table so it looked up the story record we have one zero zero three two right there which is a story record and then we can see that it did this logic to make sure it was an incident or a task and then it added the work note to the incident so you can see incident there's the work note there in the Middle where it got added so just a couple of lines in the flow designer and we were able to solve that dilemma of comments just coming to the story record but not necessarily coming to the parent record where that story was created from so now everybody has all the information they need when we're synchronizing tasks whether that be incidents whether that be customer service task or any other task in service now all of this will still work you may need to change your filters and your conditions and what records you're creating but hopefully through this series of videos you can see we can integrate these two things very easily and then use flow designer to do lots of automation especially on things like comments in this video I hope you found this video helpful if you did please like Please Subscribe or share with somebody who you think might be interested in replicating comments to from Child records to parent records and a special thanks to Jim for suggesting this video and until next time don't forget to always be learning thank you [Music] foreign

View original source

https://www.youtube.com/watch?v=ZwCs-2Bfk6w