logo

NJP

ServiceNow Jira Spoke: Project to Project Pt 1

Import · Aug 15, 2023 · video

come back [Music] hey everyone it's Justin thank you for watching and welcome to my house that's Justin's house in this video I've got more of the jira spoke for you that's right servicenow and jira we're going to integrate the two and then this use case we're focused on projects and service now being having projects created or updated in jira in this particular video we're going to focus on the crate part and in the future video we'll do the update part because a little more work involved on the update part but let's take a look at what I got up behind me I've got a project here leave of absence no work authorization notice I've assigned this to myself I'm going to use that as the trigger or as the filter for what should be sent over to jira because my user account is actually in jira and we're going to start with a flow now I've got one already set up here so you didn't have to painstakingly watch me created but we're going to walk through it first I have whether a project is created or updated and then of course what I just told you I have filter I'm filtering on whether the project manager is Justin Meadows that's me and I want to do it for each unique change because what the use case here is there might be updates to a project we need to update that information in jira so I want every unique change including an update or including a create to go over and then my first thing is going to be if Ajira project is already created how do we know well when we create a jira project we're going to update the project record and servicenows correlation display to have this string my jira integration now I just picked this up out of nowhere it could have been my cool jira integration my awesome Geo integration my horrible jira integration I just chose my dear integration and that's what I'm going to use for all of my projects that I send over to jira the important piece is that to use the same thing because we're going to use this in a couple of places to determine what to do so if that exists then that means I've already created in jira because that's what happens when you create it and then that's going to be the next video so you see I've got a placeholder activity there we need to update the jira project record and we need a custom action in order to do that but in the meantime because we're just starting this if it's not already in gear then that means we've got to create it so then the else is true and we need to do a couple of things the first thing we're going to do I actually kind of stumbled on this one a little bit we need to look up the project manager's user information in jira and I could not find a lookup user action in the jira spoke which was really weird so I'm using the lookup users stream in the jira spoke and if I get my head out of the way you can see there that this particular one allows us to return a list of users and we can specify how many pages right that's how many users are in each page and then the query so we can query things like display name and email address to find the users we're looking for and we're going to get back some really important stuff what we need is we we need that account ID and I believe we need the display name now we have all this other stuff which is fine but we shouldn't really need that what I did in mind is I actually searched for uh let me move my head back over to the right I searched for where the employee or the project records managed project manager's email address so that's my query so I've just basically said hey there's the trigger go to the project record look at the project manager we'll scroll down to project manager and then let's pull that project manager's email address which is in the ease right there and that's going to be my search string or my query when I look up users now I know I'm only going to get one back but this particular thing is actually going to return possibly a collection of users and so when you configure this it's going to automatically default to a for each item in the lookup user stream all right so that's fine that's fine we know we're only getting back one but be careful when you're designing this you may get back more than one so you may need some if logic before you go and do anything to see if you got the user you're looking for so just be wary of that and then I'm going to set some flow variables now the flow variables let's go ahead and kill that help screen I'll go ahead and show you no big deal there my lead account ID and my Project Lead this is an ID and this is a name and I'm going to have them both as strings so when I Loop through that I know I'm only getting one so I'm just going to go ahead and set the lead account ID to what comes back from that lookup user Stream So if we look at my head's in the way again if we look up the lookup user stream we go to users and we should see an account ID so that's what I chose there and for the Project Lead let's go ahead and get out of there I did the same thing but chose the display name so look up users user and then display name that's what's showing there so if I hover over each one of those you should see that account ID and display name we're going to store that as a variable because we need to use that to create the project which is it happens to be the next step so this is creating the project in jira so the project key again your mileage may vary may want to do this differently I chose to use the project number so if I just scroll down here to number that's what I'm going to have as the project ID so trigger project record and then the number that's what I chose if I hover over that you'll see there it should say number for the project record for the name I chose the project name for the account lead or lead account ID I'm using the flow variable so you just click on the Picker here flow variables we get account ID same thing for the Project Lead flow variables and click on the project lead name so those are coming from there in the description I chose the project description so trigger project record and there should be a description field if we scroll down here and there is description okay simple simple simple not that complicated and we've already tested we could talk to jira so all this stuff should work without any issues now that we've created the project into here though we need to make service now aware that that project exists over in jira and they should be in sync so we're going to update the project record that triggered this whole flow we're going to set the correlation display to my jira integration remember we could have set that to anything but we chose my gear integration you can see it here on the if statement my junior integration so those things need to match so we're going to go ahead and set that and then we're going to set the correlation ID field of the project record to the ID of the project so if we go to that create project you'll see in the project field we have ID there is something we can choose I just realized my head might have been in the way a couple of those things but so create project project ID and then the ID so that's going to be stored in service now so that the next time there's an update and it runs through this flow it's going to stop here and it's never going to go to this create place because it already knows the project exists last thing I thought was just a nice Finishing Touch is we're going to add a work note to the project called do your project creating successfully project URL and then add the project URL you can see that under create project going to project and there's the URL so nicely done we can handle all that and everything will be there and this should successfully create a project now remember I've got this project here there's no work notes on it and if we go back out of screen it should have no um no correlation ID or correlation display so here's the leave of absence and I'll just highlight it here the entire row so you can see it and notice um I'll just I'm gonna have to scroll over to the right here for a second let's just scroll that way there we go I got both of my fields in view now so there's one zero zero one eight project Leaf of absence and notice my correlation ID and my correlation display values are blank at the moment so this hasn't been synchronized and that means we're ready to test let's go ahead and check jira make sure it doesn't exist over there we'll hit the refresh button there's all my projects I don't have anything for this Leaf of absence project we'll let that refresh here all right everything finished refreshing so we'll move that out of the screen and we'll go ahead and test this so I'm going to use the test when your notices flow isn't active yet because we're still building and I'm going to select that leave of absence project that has me assigned as the project manager so there we go leave of absence no work authorization I'm not going to add any change Fields I don't want to run it in the background I want to run it in the foreground so I know when this is done and I can go check everything to see if it worked so that's running and we'll let that finish all right my test is finished running let's check out jira and see what's new over there so here is uh the jira instance I'm just going to click refresh again and we should see yes sir we do have a new project for leave of absence no work authorization project key is the project number so there's that one zero zero one eight we have the lead as Justin Meadows there it is so everything worked great there I can open this and start working on this project in jira now let's take a look at what that looks like in servicenow let's go back to that project and we're just going to refresh this list and we should see both the correlation display and correlation ID got updated according to our flow and there it is my zero integration is the display and the ID is one zero zero zero six which is the ID of the project record if we open that project record up let's we should have a work note saying that the project record was created and a URL linking us to that and sure enough if we scroll down to the notes there it is do your project successfully created and there's the project URL and my instance name which I'm going to have to blur out but there's that project ID one zero zero zero six so that's all it took in the next video we're going to go over the top part here and that's it the project already exists how do we update the project and we're going to create a custom action to do that yeah in the meantime 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 synchronizing or sending projects from servicenow to jira and until next time don't forget to always be learning foreign [Music]

View original source

https://www.youtube.com/watch?v=HY006_ohQvI