Rejecting Jira Issue it is linked to Shotgun None (None)

When I update “Assigned, Status, Start Date, Due Date” in Shotgun I get the following error in web app:
2020-09-11 12:38:04,392 INFO [shotgun_session] Connected to https://{mysite}.shotgunstudio.com.
2020-09-11 12:38:05,671 WARNING [entity_issue_handler] Rejecting Jira Issue {JiraKey}-22. Expected it to be linked to Shotgun Task (5860) but instead it is linked to Shotgun None (None).

This error is only thrown when a Jira ticket is already created and we plan to update aforementioned values in Shotgun.

2 Likes

Hey there mbk,

Before we dig any deeper, I think I might need to ask some contextual questions:

  • It seems like you might be using the shotgun-jira bridge, but I’m not 100% sure. Can you confirm?
  • When you say you’re updating (what I assume are Tasks), how are you doing the update, via the UI or via the API? Or are you changing values manually in the web-app? If so, are any AMIs involved? Are you bulk-editing the values or changing them one at a time?

If this is a Jira Bridge issue, I may grab someone from the relevant team to have a look and see what help they can offer.

Let me know!

4 Likes

Hey Tony,

I am using shotgun Jira Bridge. I updated the fields manually on the website through UI.

1 Like

Thanks for the clarification. I’m going to see if I can grab someone from that team to give you a hand. Hang tight :slight_smile:

3 Likes

Hey Tony

Just follow up message. Did you hear anything from team regarding the issue? We are still experiencing it.

1 Like

Have not yet, but I’ll be in touch as soon as I do!

2 Likes

Hi @mbk,

It looks like the Jira Issue was not properly created int he first place. Can you confirm this by looking at the issue in Jira and seeing what values are set under the Shotgun Id and Shotgun Type fields? My guess is that they are empty. You should be seeing something like this in Jira:

jira_issue_fields

If those values are in fact empty, then you’re running into a problem earlier on in the process. In that case try creating a new task, wait for it to sync to Jira, then take a look at the debug logs from the bridge. There will likely be something in there about not being able to set the fields correctly. That will be the root of the problem. Let me know what you find at that point and I can help you resolve the issue.

Ehsan

5 Likes

Hey Ehsan,

Thanks for your response. So apparently those fields were not in Screen (in Jira) thus they were marked as None. All I had to do was to add them in a screen and it’s working.

Seems like The Sync is one way (Shotgun->Jira). If I make any changes in Jira it wont get posted on Shotgun. Also, if I make any changes in Shotgun it only updates that specific field in Jira.

1: Created a ticket in Shotgun
2: Now assigned the ticket to Person A
3: Open the Jira ticket created by Shotgun
4: Updated the assignee to Person B in Jira manually
5: Went back to Shotgun task (Waited for 5 min the assignee was still Person A)
6: Updated the shotgun task - Changed the status to In progress
7: Went back to Jira ticket and notice that the status is updated to in progress but the assignee is still Person B
If Jira -> Shotgun sync is not expected, the Assignee should be updated to Person A (thats what on Shotgun Task)

2 Likes

The fact that each event only updates the specific field that was changed is expected. I wouldn’t worry about that.

Updating the assignee in Jira should update the assignee in SG. My guess would be that the bridge was not able to map the Jira user to a Shotgun user. There should be something in the debug logs that tells you what went wrong.

If you are using Jira Cloud, make sure that the update_shotgun_users script was run after the user was created. The script matches users by their email address so make sure your Person B has the same email in Jira and SG. After running the script, make sure the sg_jira_account_id field for the user is populated in Shotgun.

If this is all set up correctly the sync should update SG assignees when Jira assignees are updated.

3 Likes

I ran the script again and verified that both user A and User B are matched and the jira account id was populated but still experiencing same issue i.e unable to sync Jira -> Shotgun.
There is no logs in the console when updating any field in Jira while when I update in shotgun it displays the logs and change appropriate fields

2 Likes

First, make sure that when you are making changes in Jira, you are not logged in with the same credentials that the bridge uses. The bridge ignores events from this user.

If that doesn’t work, enable debug logging on this line in your settings file and restart the server.

If you’re still not seeing any logs when something changes in Jira, it’s very likely that the Jira webhooks are not making it to the bridge. Check to make sure you have the correct address set up in the webhook and that you have followed these steps.

If you are using ngrok as described here, make sure that after making a change in Jira, a corresponding request shows up in the ngrok output.

Once all of that is working, you should see a debug log for every event that happens in Jira. If the synching is still not working, the logs will tell you why.

4 Likes

Making changes in Jira through a different account did update Shotgun. It’s not mentioned in the doc, anyways good to know.

3 Likes

You’re absolutely right. We had actually made the change to the documentation on github to describe this behaviour but it looks like the updates never made it to the developer site. I will make sure to update the documentation there as well.

4 Likes