Resolution values not syncing between GitHub and Jira

Hi there,

I’m using the instructions here to attempt syncing Resolution values between GitHub and Jira. Unfortunately it’s not working and adding the scripting from the article linked above causes our statuses to no longer sync, which they were successfully doing previously.

Here’s the outgoing sync on the GitHub side for the connection in question (Discourse is telling me I can only upload one screenshot… so I’ll try uploading the rest via comments)

Any help is appreciated!

Joe

Hi and welcome to the Exalate Community!

Thanks for sharing your question or insight, we appreciate your contribution.

A member of the Exalate team or community will review this post and respond as soon as possible.

In the meantime, feel free to explore related topics or join other conversations. We’re glad to have you here!

Here’s the incoming sync on the GitHub side:

Here’s the outgoing sync on the Jira side:

Here’s the incoming sync on the Jira side:

Hey @jcotant

I understand that when you add the lines to sync the resolution the status sync stops working.

Could you please specify on which instance the status sync stops working?
From Jcloud to GitHub or GitHubd to Jcloud? Both??

By the way, GitHub does not have resolution field under the issues, are you trying to sync the resolution to labels or are you using a projects on github?

Best,
Kevin

EDIT:

Hey @jcotant

I was working a little bit on this and I can confirmed that you cannot use the normal script that you took from here, that sync its for Jira cloud sync is not compatible with Github and gitHub does not have a resolution field.

At the the moment you can see from here which fields you can sync on GitHub.

An approach that I have worked is to sync the resolution from Jira to gitHub as a new label with the custom mapping if this approach works for you you can achieve that with the following snippet

Github incoming

if (replica.resolution == null){
  return
}

if (replica.resolution != null){
  def resolutionMap = [
    "Done" : "Completed",
    "Won't Do" : "Not planned",
    "Duplicate" : "Duplicate",
    "Declined" : "Not planned",
    "Cannot Reproduce" : "Not planned"
  ]
  def targetResolution = resolutionMap [replica.resolution.name] ?: "Completed"
  //debug.error(targetResolution)
  issue.labels += nodeHelper.getLabel(targetResolution)
}

This snipnnet will add a new label on GitHub when with the resolution from Jira cloud.

Let me know if this works or if you are looking for another approach.

Hi Kevin,

Thanks for jumping in here. Once I added this code to the connections, I created an ad hoc ticket from GitHub → Jira and the statuses fell out of sync immediately (see screenshots taken once the replicated ticket was created in Jira). Updating the status in one system doesn’t sync with the other (the scripting used for status syncing that’s present in these connections was working fine before the Resolution code was added). Please LMK if there’s any additional info I can provide.

Thanks!
Joe

Hi Joe,

The snippet that you are currently using to sync status seems fine to me.

Based on the scripts provided if the ticket is set to Open in Github on the Jira cloud should be submitted.

If the Jira status is set to:

Submitted or Open it should be Open on the Github side.
In progress, in review or Blocked/on Hold it should be in progress
Closed should be Closed.

However, In progress status does not exist on the GitHub default status. It can only be Open Close.

Also, I would recommend to remove the resolution code as you have it now, as I explained on the edit of my previous comment, Github does not have a resolution field that Exalate can edit.

So the options would be to use a similar snippet as the one provided before or it could be adapted to Exalate add a comment with the resolution once the case was marked as closed on Jira Cloud.

Best,
Kevin