Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,640
Community Members
 
Community Events
176
Community Groups

How can I use Exalate to sync user fields between Service Now and Jira Cloud?

Edited
Rob Horan Community Leader Dec 08, 2021

I realize this is an Atlassian community space, but it's Jira related, and I could really use the help...

 

Using Exalate, I am trying to sync fields between SN and Jira, and it is just seemingly impossible.  Here are the fields I am looking to sync, SN on the left, Jira on the right.

 

 

requested_for Reporter
assigned_to <>  Assignee
watch_list Watcher

 

 

It gets a little more complex since one of the issue types we are trying to sync from in Service Now is catalog task, so that definitely messes with the field name there, but in any case, I am getting nothing but errors when trying to get info from SN to Jira.  This i the key transition point since the initial trigger is the creation of a catalog task from SN which creates a task in Jira.

 

Has anyone cracked this problem yet?  I can't even seem to get information to leave SN without an error.  For example - look at this anonymized error:

 

Error Detail Message:
Cannot cast object '{display_value=John Doe (JDOE), link=https://client.service-now.com/api/now/v2/table/sys_user/68cea2c52c4c32c0c8e2a692842efa26}' with class 'scala.collection.convert.Wrappers$MapWrapper' to class 'com.exalate.api.domain.hubobject.v1_2.IHubUser' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.exalate.api.domain.hubobject.v1_2.IHubUser(scala.collection.convert.Wrappers$MapWrapper)

 

Is there documentation which clearly states how to sync user data between these two issue trackers?

2 answers

Hi @Rob Horan 

This is Dhiren from Exalate.

It's easy to synchronize user fields between ServiceNow and Jira. Let me give you a small example for Reporter/Assignee field.

Let's say you want to map Assigned To from ServiceNow with Assignee in Jira, and another one could be Caller (from ServiceNow) to Reporter in Jira.

Now comes the interesting part, the script that needs to be written ::

 

ServiceNow Outgoing Script :- (I am assuming you are trying to sync Incidents, but you can practically sync anything)

if(entity.tableName == "incident") {

    replica.key            = entity.key

    replica.summary        = entity.short_description

    replica.description    = entity.description

    replica.attachments    = entity.attachments

    replica.comments       = entity.comments

    replica.state          = entity.state

    if(!(entity.assigned_to instanceof String)){

  replica.assigned_to = entity.assigned_to.display_value }

if(!(entity.caller_id instanceof String)){

  replica.caller_id = entity.caller_id.display_value }

}

 

Now, when this payload comes to Jira,

Incoming Sync Script in Jira can be :

//issue.reporter = nodeHelper.getUserByFullName(replica.caller_id) 

//issue.assignee = nodeHelper.getUserByEmail(replica.assigned_to)

You can also set a default user value in case this infomation i

 

You may use any method in nodeHelper class, I hope this helps buddy! 

For more information regarding this please browse through the Exalate Documentation

 

Thanks,

Dhiren

Rob Horan Community Leader May 21, 2022

Maybe I'm the kindergartener in here (I'll own that) but here's the thing.  By saying you may use any method in nodeHelper class, there seems to be an assumption that we would all know how to use that info, and I definitely wouldn't.  

I'm just saying this isn't quite what I would call easy :)

francis Marketplace Partner May 23, 2022

Hi @Rob Horan ,

 

(I'm a colleague of Dhiren, and also with Exalate)

 

We know that there is a learning curve here - and it is not easy for rooky users
The details of the nodeHelper class is detailed 
https://docs.idalko.com/exalate/display/ED/nodeHelper

Let us know how the documentation can be improved.

Rob Horan Community Leader May 24, 2022

Thanks @francis ,

You know firsthand some of the difficulties we had getting certain things to work, and - at least I hope yu and your team know - how much we appreciated the advice and support your team provided while we were working through some syncs. 

For many, I think the learning curve starts with not knowing where to begin.  There's a certain level of knowledge expected going into this documentation, and where/how to go to get that knowledge can be more nebulous.

Rob Horan Community Leader May 24, 2022

@Dhiren Notani_Exalate_  I meant to pass along my thanks earlier and I didn't, and for that I also pass along my apologies - and yes thanks as well!

So this is going back months, and I had to dig deep in my email to get the info back.

We solved this, but it took a lot of work - FAR more than what was written above.

Can I honestly say I understand how this works?  No - and that's my concern.

On the SNow side, the outgoing sync looks like this:

  if(catalogTask.assigned_to && catalogTask.assigned_to != ""){
    //We only get inside this block if the assigned_to has a value
    replica.customKeys.assignee_email = nodeHelper.getTableByLink(catalogTask.assigned_to?.link)?.email
  }
  replica.customKeys.reporter_email = nodeHelper.getTableByLink(catalogTask.requested_for?.link)?.email
  
        DateFormat formatter = new SimpleDateFormat(datePattern);
        replica.due = formatter.parse(catalogTask.due_date);
}

 

And then in Jira

def snow_assignee = nodeHelper.getUserByEmail(replica.customKeys.assignee_email)
// only changes issue.assignee if remote assignee is found
if (snow_assignee) {
    issue.assignee = snow_assignee
     
}
// debug.error("assignee = ${snow_assignee}")
 
def snow_reporter = nodeHelper.getUserByEmail(replica.customKeys.reporter_email)
// only changes issue.assignee if remote assignee is found
if (snow_reporter) {
    issue.reporter = snow_reporter
     
}
0 votes
Stefan Salzl Community Leader May 21, 2022

Hi @Rob Horan ,

First of all: I‘m mainly dealing with Jira Automation and also rooky exalate user. 

From Jira automation i now that the field „Assignee“ (and i guess also the field reporter and watcher) take the userID instead of the display_value (which is the name that is shown in Jira fields and is showing in your error message). 

So this is just my personal guess but could that be processed with a script to match the name that is sent from SN with a Jira User and get the userID to fill in into the fields in Jira?

Pleasr let me know if this might be helpful or if there are any further questions.

Best
Stefan

Suggest an answer

Log in or Sign up to answer