ServiceNow Integration with JIRA | How to integrate ServiceNow and JIRA

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in order to subscribe to my channel please click here or click here please share comment and like my videos and channel hey guys this is god of welcome to SAS word service now in this session you will learn how exactly you can integrate ServiceNow and JIRA system service now and JIRA when you will integrate ServiceNow and JIRA system there are two different systems so we need service now and we have JIRA they will be connected with the help of API both the systems can communicate with each other with the help of API ServiceNow might send a call to JIRA to get some data to feed some data and JIRA might call to service now to get some data to feed some data into service now what we need to integrate in order to do this integration what exactly we need so we need two systems one is ServiceNow then we need JIRA in service now we have to decide that which module we have to integrate in this demo we will integrate agile development 2.0 with JIRA system then we have to think about trigger condition now all these things will come from your customers so they will provide you what exactly they want this integration or maybe as an architect you can also suggest some solutions to your stakeholders then you need outbound rest message that means you have to trigger a rest message from ServiceNow to JIRA so that you can communicate with JIRA System for giv need n point so that ServiceNow will note that end point and will be able to communicate and get the data or feed the data into JIRA system we need authentication that means ServiceNow should be able to authenticate with JIRA then we need resources that what kind of resources ServiceNow can connect to how saris now can create issue how ServiceNow can create project how exactly it can fetch issue and projects or any other data which is in JIRA system we also need to talk about more details of JIRA system that means we have to confirm what fields we want to map in ServiceNow fields as well so for example we have agile development 2.0 now what fields of JIRA system if we fetch those data into ServiceNow it should be maths - what fields of ServiceNow agile development application then payload what kind of payload we need so that we can create any record in JIRA system then method what kind of method we have to utilize maybe post get or different other methods of rest integration we also need to have our own instance so you have to get your own instance you can see I have my own instance that is SAS now dot @ elation dotnet this is my own instance which I registered JIRA now in order to proceed with JIRA integration because if you are a service node developer now it might happen that you're not aware of different details of JIRA system because you are you are just a service not developer you are not a Gina developer in that case you might need to refer lot of things so that you can integrate with JIRA system that means REST API document which is provided by JIRA so equation provides this data they have a website where they have all the rest API documentation then we need JIRA software now in order to do this integration you have to have this instance for demo purpose you could definitely get a new instance of jitta JIRA software I will show you how exactly you can get it so this is the website where you can get and register for a new instance of JIRA it is also mentioned in the description of the video then you have jitta API example now JIRA documentation also provides you examples that how exactly you can use for different situations for different use cases that's something you can see with ng JIRA API example and we also have a website for that a link for that so that you can just access it and whatever action we take like creation of the issue it is just an example you might find find more examples over there you need directional from ServiceNow now as part of this demo this integration will be a unidirectional that means only ServiceNow has access to connect to JIRA JIRA does not have access to connect to ServiceNow so all the calls will be generated all the transactions will be generated from ServiceNow so service now will become the source instance and JIRA will become the destination we will trigger the call from ServiceNow it will send a call to JIRA instance maybe for getting or fetching the records or maybe insertion of the records and then JIRA instance will revert with the response to ServiceNow that's how this unidirectional integration would work the next part is register for JIRA and ServiceNow instance that means now we will talk about the procedures but how exactly you can integrate both systems now as part of this demo or maybe if you want to do it practically with your personal developer instance then you have to follow these steps now there are some steps which we you might need to you might not need to follow for example registration of ServiceNow and JIRA maybe in your organization because in your organization these systems are already being used so if you already have JIRA you already have ServiceNow then you don't have to register for them and and the important part here is because if you are a ServiceNow developer then you just need to worry about your instance ServiceNow whatever development you will do in your instance if there is some configuration needed any authentication details needed or any kind of development needed maybe for bi-directional or any any any other kind of configurations needed from JIRA system in that case JIRA developer should be there in your organization or any any team member and they should be able to provide those informations so as a ServiceNow developer you don't have to worry very much about these details because you would definitely have these JIRA developers if you don't have those developers then you definitely have to learn that how exactly you can do develop and encoding in JIRA system to to do this by directional integration else we can just directly do unidirectional integration that's it so the first step we have as part of this demo and as part of the practical experience which you can do as part of this integration is registered for JIRA and ServiceNow instance if you are a service node developer so you should already have ServiceNow instance or if you have not stirred yet then you can register one and get your ServiceNow instance similarly for JIRA you can just go to this website it is also mentioned in the description and you can just click on drive for free and then you can get your instance we have to register for it and make sure you are getting cloud instance so that you can perform this integration because in order to do that you have to have cloud instance so that you can do it and test it practically with your personal instances create a project in JIRA once you are registered in JIRA system so if I go here so I have this instance so this is my instance of JIRA you can see I have here JIRA software and these are all my records issues which I have created in JIRA system I can create new as well if I want but I want to integrate today this instance with my ServiceNow instance so you can create a project here but I have already created one so in that case you don't have to create it but if once you will register once you will get the instance the first thing you have to do is create a project then you will validate if a giant development is enabled in service now I'm talking about this because if you are performing this integration this module has to be enabled then only you can do this integration so if I will go to my instance and I will go to my ServiceNow instance here and I will do agile so you can see I have this module already enabled I enabled it with the help of plugin if it's not available in your instance in your ServiceNow instance then you can do that with the help of enable and enable the plug-in you have to activate that plugin agile development 2.0 then you have to create authentication token in JIRA now as you have to connect to JIRA instance you have to have authentication so that ServiceNow can connect to your JIRA instance in that case you have to go to JIRA and since here once you will resist her you will get this instance you will go at the bottom here your profile and settings you will click here once you will click here you will see this option account settings once you will click on this account settings it will take you to this page here you have to click on security once you will click on security you have to click on create and manage API tokens click on here once you will do that you can see I have already created one API token but if you have a new instance then you won't see any record over here and then you can click on create API token and you can given a label name and then you can create API token and it will also give you the API token but you have to save somewhere which you have to utilize in service now let's perform this development in our ServiceNow instance so that we can do this integration and we can create some records we can fetch some data from JIRA instance in order to do this integration you have to know the API documentation provided by JIRA if you will go here you will see the ServiceNow provides so this is the URL which is mentioned in the description well you can see all the API documentation that what exactly you can do with the help of REST API of JIRA you can see we can create issue bulk create issue get issue we can create projects there are a lot of things over here so there are a lot of resources which you can utilize and then create and and fetch data from JIRA instance so let's start with our instance now in order to perform this development first we will do a testing we will see whether we are able to fetch data from JIRA instance the one which I have registered or I have JIRA instance for that what I will do I will go to rest outbound message so if I click here and the outbound you will see rest message I will click here I will create an outbound rest message so it's JIRA testing demo for YouTube that's a name you have to put the endpoint now what should be the end point so the end point should be first of all your instance name till here so you will go to your instance still here you will have this instance name and then you will check here and it says you have to add rest api 3 because this is rest API version 3 so in that case you will do this add it and you will go here and you will add this so this is my base URL this is the end point I have now I will select the authentication so I will do basic authentication I have to select a profile I already have a profile that is JIRA 2.0 where I have already used the username as email address the email address which you are registering your JIRA instance and the password would be that token key which you will get from JIRA instance while creating that token that's what you will get and that'll be your password now I will just click on save it is saved I also have HTTP request so maybe I will just put except here it will be application / ji-sun I will copy this and I want content type and that should also be JSON that's it I will save this now I will go to my default get because when he will create this rest message you will see your default get I will click here till now I have this endpoint but you can't connect to jitta instance or maybe you can't get the data which you want because the reason behind it if you have not added the resources you actually need to do this so in that case what you will do you will go to your instance and we have to check how exactly I can pull the data and that will be querying and that can happen search for filters or maybe issue search now here we will do issue search I think search for issues using jql so I will try to get some data from my instance so this is what I need so I have to send this call till jql and I can just utilize the jaql query so if you will see like this I can search for the records so in this case if you will go to my instance right here I have I can put here a query that reproject project equal to sass this is what I need sass now and I will click on search and you will see all these data so what I can do I can copy this so in that case it will go to your endpoint here you will add a slash you will type search that is what it is telling you let's take a look yes search so after three you have to add search then you have to put question mark you have to do jaql and then you can put equal to and like this equal to project equal to sass now and you can click on save once you will click on save you know as before you can see we have these HTTP headers blank so let's try to put them so we have accept application slash JSON I have content type here again application slash JSON that's it for now I can click on save and now I will just click on test let's see what happens it got succeeded you can see we we got HTTP status as 200 and we also got the response we got around seven issues which we already have in our instance now how exactly you can read read this JSON this response in order to do that because this will be really helpful to you when you will do your coding in that case you need JSON viewer now this is the website which is utilized to see all the objects of your JSON so you can click on here you can paste all the data you got from response and just click on viewer if you click here now you will see the JSON data and you can see all the objects you have here all all the objects and their values the first use case is to create JIRA record when a story is created in ServiceNow that means in agile development when you create a story it should automatically create a JIRA record in JIRA instance so let's go to ServiceNow developer instance I will go to agile over here and here we have a stories if we click on stories now the condition is when you will create a new story it should create JIRA and JIRA instance automatically so in that case what you have to do you will write a business rule so what we will do we will go here configure business rules so I'm going to create a new business rule clicking on business rule here I will give it a name as create JIRA now when exactly I need to run so there's no condition it has to run every time I insert the data so in that case it should be after a sink or maybe let's do a sink you can also do after but as we are doing this integration let's do a sink then we will do you that we have this advanced so now we have to do this coding let's begin the coding so this is the coding part now so we have to create JIRA record that issue in JIRA instance so what we will do we will start with body so first I have to make the body now how exactly I can make this body I will show you you have to go here here you have on JIRA example and you can see we have this input data so I'm just picking up this example where we have summary issue type and key in that case I will just pull this there's kind of a request body payload I will go to my instance and I will paste this I'm just showing you each and every step that how exactly you can test it because it might happen that you might can you might you can do some mistakes so I just want I don't I just want that whatever I'm showing you you follow each and every step so first I will just structure this data whatever I got from there so I am doing like this okay I will show you static data as well and also dynamic so we will do a testing with static and then we will make it dynamic so that whatever values we have in JIRA in ServiceNow story we will automatically create in JIRA as well that will automatically show in Judah so in that case let me do this I'm just making this and you can see I'm just like name equal to bug so you can also create a bug if you want directly from here now in this case I have to close this first because this is a string now we copied this JSON data but we have to convert this in just directly as a string so that when it goes to the like JIRA system we have to we have to show it as JSON data now how exactly we can make it because you have added double quotation here which we can't do that here in that case you can do this this here we have to change the key the key is SAS and front in place of name I can make it story and this is JIRA demo and in description I can also right demo JIRA description and this is JIRA demo maybe summary so in that case I have here slash slash and I will do here as well so I will continue to do that now as you know because we are we are making the string so we can't have quotation in this string yeah so for for for sending the quotation as a string you have to use this so we're doing this for this as well wherever we want to send as a string this one as well this one this one you don't need to do this one because this is the quotation for strength so we have created the body now we have to create our Albin rest message so how exactly we can do that we can type there we will create the quest variable equal to new SN underscore W s dot you can see we already got so we have to do rest message v2 so we will do rest message v2 now we can do request dot we will set the endpoint so we will do set endpoint now what endpoint should be because we have to create now we have to create the racket in that case you will go here you will check that how exactly we can create the record that means create issue we will come here and the URL would be so after three that means version 3 API we will just add issue and that should create it so in that case I will copy my instance go here and I will put the endpoint now you can make this endpoint dynamic as well as per your requirement now I will add here rest slash API slash 3 and then I can add issue because I have to create issue that's it then I can do request dot set HTTP method so I have to set HTTP I think that's not populating but we have to do set HTTP method and that would be post because we want to create the racket so we will do post then we will do request dot set request body so you can see I'm starting the request body which we created over there as a variable that will be body here now I will use their user so user is my email address so I will type email address and I have registered JIRA instance with this email address so now you can definitely create multiple users in JIRA instance and you can you can utilize that as well but it depends on the axis that particular user user has so in that case I have given the email address and then I will give password now password is the token key the key which we got from JIRA instance I have saved that key somewhere so let me check that so maybe I have to get another key in that case so let's go to your instance go to API tokens and click on create API token so I will click on oh maybe I will first revoke this one I'm revoking this one confirm now I am creating new one once again assess now create it I have this API key I have copied it to my clipboard and I'm going here and I am putting right here it's there then I will do request dot set basic auth that is basic authentication which I am doing here I will give the parameter like user and password and I can do request dot set a request header because we have to put the request header and that'll be accept so accept would be application slash JSON and I have to add other header that is set request header and that'll be content type coma and I can just put application slash JSON that's it and then I can do there maybe just give a little bit cap here next line there I can do response so how this response would be coming there will be request dot execute so this is how I will I will get this I will get the data so I will just send it now as of now because I don't need exact response as of Nam because we are just doing testing whether I am able to create the record or not so what I will do I will just do a GS dot log so that we can log whatever I am getting so I can do whatever i am response whatever response I'm getting from JIRA instance I can just do that so response dot get body and that's it so this will be logged in your in your transaction logs so that's what we are doing so in this case I will save this so I'm going to save this it is saved I just realized one thing that we have done a little mistake here you can see we have used soap message but we have to use a rest message here so I will do dot a rest message v2 I will also try to just remove maybe this description because we don't we will just try with the summary for now so we have used just summary and everything else is okay and I will save this once this is saved now you can try to create a story here I will click on new so as of now I already created one issue you can see we have eight zeros here I can do test for demo I will save this when I will save this it will send a call to JIRA instance and should create one more JIRA over here if I yep we can see and it says this is JIRA demo summary you can see we have this whatever we mentioned over there whatever we mentioned in this script so as you can understand as of now this is static data which we are sending to JIRA instance now what about dynamic data that means whatever whatever information you are putting over here why don't you put this short description in JIRA summary in that case it will be really utilized and you can you can use other things as well like state maybe maybe acceptance criteria if you want that also you can use but let's just try just with short description so in that case what I will do I will get the short description so here I will do where I think we don't need to do that so we can just directly add it so maybe till summary you have till here so what we can do I can do this and just plus so till here I want and then I need just slash that and I have to put this like this plus again remove this and I can do current dot I think that's a short description we have so it's a it's a short description field I can do short underscore description plus because I want to push that data to jito instance so I will do like this and I need to add another double quotation like this now I think then you don't need anything that's it so you can see we have current dart short description we we are adding this double quotation over here and then we have colon here and then I have double quotation and comma that's what you need or all so in this case what I will do I will click on save now I will click on save let's try to create another story so in this case I will create another story so I will click on new try to give different name so that you can just just recognize that particular JIRA so here we will give demo with dynamic data from story let's see I am clicking on save so I'm inserting the story and now I will go to my instance and I will refresh this awesome you can see we have received demo with dynamic data from story so in this way you can understand we are able to create JIRA record in JIRA instance so this is or outpost method let's consider another use case in which we will create turi in ServiceNow when new JIRA is created in JIRA instance that means it might happen that users are creating DDoS directly in JIRA instance then how exactly you can get those data and do service now because you have to create story as well now as this is not a bi-directional integration that means if you will create JIRA instance JIRA will not trigger any call to service now to feed the data in this case in unidirectional you have to trigger the call again for the same situation from ServiceNow to JIRA instance because as of now this is unidirectional integration now in order to achieve this we have to write a scheduled job so that you can continuously call JIRA instance and check whether you have new jiriz and you can create a story out of them so what we will do so we have the stable RM underscore story so in that case I will go to scheduled job so I will if that's how you can keep on connecting to ServiceNow to your JIRA instance that's how you can connect so in that case we will go to scheduled jobs I will click on new I will create a new schedule job automatically run a script of your choosing yep so I want that's what I want so I will click on here that's what I want I want to run a script here I will do I will do it a name story JIRA integration as of now I'm just keeping it inactive now we will start with a script now in order to do that because we have to we have to create the story so we will send a message we will we will trigger a call from ServiceNow and then we will fetch those records which we have in JIRA and try to create it now how exactly you will make it possible that you are not creating a duplicate story because you if you have already created story which you have already replicated in JIRA as well then you don't want to fetch that particular that particular JIRA from JIRA instance for that what you need to do you have to create a flag maybe so let's go to your story here we will we will create a flag whenever we will create a new story and we will get the response from response from JIRA system we will we will keep that number so in that case what I will do I will configure this form form layout I have already created a field that's called external number I will keep it here external number because whenever I will create any new story in service now and it will create a JIRA in JIRA instance and when I will get the response I will save here so that I'm not repeating the numbers so in that case you have to do a check so what we will do we will go to our script we will write a script here so this gr story equal to new glide record so I'm checking this from the beginning but I should not check his check it right from the beginning because I have to check each and every record which I am getting from JIRA instance now how exactly I can do that first I have to initiate the rest message so I will start from here first so I can just copy whatever I created previously so that kind of call I have to create so you don't have to rewrite that maybe you can just go here business rules I have updated I have this one create JIRA because your script will be quite same but with some different logic and and this script will keep on running as for the frequency you will mention so in this case i will copy till here and i will paste it here now as i'm not going to create any JIRA and JIRA instance just remove this body here I have rest message I have this endpoint now here endpoint will be changed now what that endpoint would be the endpoint will be basically you have to do search so if you remember when I was showing the demo in the in the beginning of my video you you saw that we were fretting fetching some inven we were stretching some JIRA data from JIRA instance now you can check here so we have to do the same thing because we are checking all the DDoS we have in JIRA instance so I am going to do search question mark and I'm putting jaql equal to and I will do Project equal to and I will put sash that's my project name here I will do get I don't need to send anybody over here that said my username and the password will be same so no change in that request here if I have so I can just content type can be removed I don't need this because I'm not sending any kind of request body so I don't need that I have then response response down execute now I want to create I want to create story from all the Gira's I have in JIRA instance from all the issues I have over there now how exactly I would do that in that case first I have to get the response and then I will get the response in JSON format and I have to parse it so that I can read its objects get those objects and I can use it for creation of story so in that case what I will do I will first create a variable that is parsed data equal to json dot parse and here i can just put response dot get the body this is what i can do and then i can now i have to do a loop here so i have i have got i have parse the data jason jason data so i will get all the objects and its and its elements and its values basically from jason record if you remember i am talking about this one all these data so in that case so you can see we have different number of racquets in this case you have to utilize array because that's how you can read like zero one two three and you have to use loop so what I will do I will I will just loop and till when we will loop till the number of total number of records I have minus one because we will always start from zero for array I have to start from zero so in that case I will do loop equal to and that will be parsed data dot total that's the object I have over there and I am putting minus one minus one so so that I can get the value to loop and then I will put for I equal to 0 semicolon I is less than equal to loop semicolon I plus plus now here I will check whether that particular racket is available or not how exactly I will check it so I will do there gr a story now we will hit a story table new glide record here I will put RM underscore story here I can pair gr story dot add query so we will do a query and here I can put the field which we have that is external underscore number I can do comma now here I can put parsed parsed data dot issues if you will see here I have this issues I'm just using that and then I am putting array I will put I so that it can loop and then I will do key I will do : semicolon here and then I will do gr story dot query so if I will not be able to find any record then I will create it so in that case I will do gr story dot next and I will do something so here if I'm not able to find anything then I will create a racket so in this case I will do where G story story create equal to new glide record again same that is RM underscore story you can do gr story create dot initializes because I have to insert the data now I have to use the short description whatever I have in jitta instance so in that case what I will do I will do JIRA is story create that short description equal to I will use the data I'm getting from JIRA that is parse data dot issues so that's correct issues I and I will do dot I have to use fields now fields and I will do summary so here feels and then I have summary how exactly I'm getting this fields I will show you you can see I have these fields but you can directly use this key after issues dot so I will go here and I will just create it so I will face the data but I have I also need to put the G Rockies I will do G gr story create dot here I have you underscore external number equal to so I will do first data dot issues I dot okay I don't need to do this I can directly do key that's it and I can do G our story create dot insert so I'm inserting this data I am formatting my code a little bit so it will insert the story if it did not did not find any record that means with that external number now you can see I have written wrong so your code will not run if you will write wrong send texts so I have number number everything seems to be right I'm just logging this if you want to do that maybe every every time it will just give me the whole whole response in the log so I have this far till here and I am just checking that that's it I have this next till here not okay so I am going to do you save so I'm saving this let's see how many records we will be able to create so I'm just running so I'm clicking on here execute now I'm doing execute now when you will do that let's see if I have a child and I go to stories let's see all the stories have been created and I will sort this from jet to a so maybe I will I will do soar by created because number is not giving me the right showing the right list okay so we have created these JIRA as you can see demo with dynamic data from story SAS outbound this is a test rest a gentleman that's what we are using and if you will see I will show you one field so that you will see that it came with the same integration we did this is the external number and you will see an answer is yes so we have total nine records okay we got more so it got I think you forgot one thing so it also created back in JIRA instance because you wrote that query so you have to write it over there as well that if that particular number is available in JIRA in that case you don't have to create it so that those kind of checks you have to mention while doing this integration because then only your integration would be successful but anyhow our goal was to create data in JIRA instance and to create data in ServiceNow as well by fetching the data from sir from JIRA instance so this is how you can do integration now this is just a demo now you must have seen my scripting I will I will paste the script in the description as well you can just refer those but when you will do the live integration you just need to take this example and as per your business requirement from your customers and clients you have to customize your script as per your requirement and and business requirement basically whatever it's mentioned what feels we have to match what kind of data it has to be posted in JIRA or in ServiceNow that's what you have to decide because this is just a demo so I hope you like my video the whole integration and you will be able to achieve the goal of integration for your organization or whatever your goal you have for integration so thanks for watching my video have a great day
Info
Channel: SAASWITHSERVICENOW
Views: 28,628
Rating: 4.9528022 out of 5
Keywords: incident management, incident, What Is ServiceNow, what is servicenow platform, servicenow training, servicenow administrator training, servicenow tutorial, servicenow tutorial for beginners, what is servicenow software, cloud service, introduction to servicenow, servicenow, servicenow and jira integration, jira integration with servicenow, servicenow integration with jira, servicenow jira, jira servicenow rest integration, servicenow vs jira, servicenow jira rest integration
Id: vv_oHjywUxg
Channel Id: undefined
Length: 58min 20sec (3500 seconds)
Published: Fri Feb 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.