Shotgun Jira Bridge Integration setup help

Hey all I am trying to get the jira bridge setup here but dont fully understand whats going on under the hood. In the quick start guide here for setting up the jira webhook it says to enter the url ( https://<url_for_sg_jira_bridge>/jira2sg/default/issue/${issue.key}). What is the <url_for_sg_jira_bridge>. Im not exactly sure what its asking for there.

3 Likes

Hi Joseph

This is the URL or IP address to the Jira Bridge instance that you are running (not your Jira site URL.)
That’s the middle section in this graphic:

Hope that helps?
Thanks
Phil

4 Likes

Hey Philip thank you very much it might have gotten me further here but still having some issues. So I have everything set up and when I run the webapp it says connected to shotgun session and connected to jira session. Then when I run the shotgunEventDaemon it get through the loading plugin at sg_jira_event_trigger.py then I get an error of:

INFO:plugin.sg_jira_event_trigger.process_event:Retrieving sync routing for Project 94
CRITICAL:plugin.sg_jira_event_trigger.process_event:An error occured processing an event.

Traceback (most recent call last):
  File "./shotgunEventDaemon.py", line 974, in process
    self._callback(self._shotgun, self._logger, event, self._args)
  File "/local/jkiser/code/sg-jira-bridge/triggers/sg_jira_event_trigger.py", line 96, in process_event
    ["name", "sg_jira_sync_url"]
  File "/usr/lib/python2.7/site-packages/shotgun_api3/shotgun.py", line 854, in find_one
    additional_filter_presets=additional_filter_presets)
  File "/usr/lib/python2.7/site-packages/shotgun_api3/shotgun.py", line 997, in find
    records = self._call_rpc("read", params).get("entities", [])
  File "/usr/lib/python2.7/site-packages/shotgun_api3/shotgun.py", line 3273, in _call_rpc
    self._response_errors(response)
  File "/usr/lib/python2.7/site-packages/shotgun_api3/shotgun.py", line 3560, in _response_errors
    raise AuthenticationFault(sg_response.get("message", "Unknown Authentication Error"))
AuthenticationFault: Can't authenticate script 'sg_jira_event_trigger'

I am sure this is something I have wrong in my setup some where but I just can’t seem to pin it down.

1 Like

Do you have a script in your Shotgun site called sg_jira_event_trigger such that the properly configured event daemon can use it to connect via the API?

Ok so that helped a ton there. Not sure exactly where the script name was getting off but I changed the script name and updated other fields in relation and the syncing from shotgun to jira started working. Problem is the syncing from jira to shotgun is still not working looks like my web hook is not functioning here. It may be my url still on that side not sure exactly how to get that working correctly.

1 Like

Hi Joseph

Having spoken to an engineer about this. They recommended as a first step that the JIRA webhook has all the required events selected.

Also, are you running JIRA locally or is it cloud-based?

If you are cloud-based, maybe your server is unreachable from the Internet? We would recommend checking out ngrok, which allows requests coming from the web to connect to your local computer. We would only recommend this for testing though.

The webhook URL would become something like https://.ngrok.io/jira2sg/default/issue/${issue.key}. The good thing here is that you will more quickly know if the webhook is firing properly in JIRA, as you will get a lot of calls being made against ngrok even if your webserver is not up and working properly.

2 Likes

Hey Philip thanks for the info and yes you are correct we are using jira cloud and I suspect that our firewall is blocking jira from communicating with my machine here. I have spoken quickly with our IT department to look into ways around this but will also look at ngrok in the meantime as well.

2 Likes

Ok things are a bit closer but still not quite working. The shotgun to jira link seems to be working fine the jira to shotgun link however is not working correctly. I have set up ngrok and that is connected and working correctly I can see anytime I make an update in jira I get a successful http request
POST /jira2sg/default/issue/FSSHOTGUN-1 200 POST request successful
but nothing comes through to shotgun. However if I make a comment in shotgun it syncs in jira then if I try and update that comment in jira I get the following warning:

WARNING [note_comment_handler] Unable to process Jira Comment comment_updated event. Invalid Jira Comment body format. Unable to parse Shotgun subject and content from '{panel:bgColor=#deebff}
*Joseph's Note on jiraTest*

shotgun test
{panel}

'

This makes me think something is trying to communicate but its just not working correctly. I did check my webhook settings and I believe it should all be correct. Check the screen shot below. Any other ideas?

1 Like

Hey Joe, sorry I was out last week. I’m not sure what is happening here, but I’ll check in with an engineer and get back to you.
Best
Phil

1 Like

Hey Joe! We got a little info from our QA Engineer that might be helpful:

  • First off, are you guys having syncing issues with everything or only with Notes?
  • There are some known limitations/issues with Notes that might be relevant here. Does any of this sound like it might be at play?
  • You’ll also want to make sure you’re using a designated user account in Jira that will control the sync updates. More on that here.
2 Likes

Hey Tannaz thanks for reaching out so just did some testing here and read through the docs. So the syncing issue is everything going from jira to shotgun. Even if I change the status that does not sync back. The web server does a post but the shotgun event daemon does not respond to any changes. One thing I did read was the formatting issue there in the limitations but even trying to use the formatting it doesn’t work. I did also make a dedicated user account just for the posting here and that doesn’t seem to work either. Like I said interestingly enough I seem to get further if I try to modify or update a comment that came from shotgun to jira but that gives the error I posted about formatting.

Yall find a fix here? @jkiser