Flow Production Tracking - Jira Bridge "TypeError: Object of type Project is not JSON serializable"

Hello, team! I’m attempting to get the Jira Bridge up and running, and I’m having this issue when I attempt to run the update_shotgun_users.py script. It’s telling me “Object of type Project is not JSON serializable”

See below for the full error message. Everything else seems to be working, but I suspect the reason I’m not seeing changes update on Jira is because the users are synched correctly. Has anyone seem this before? Thanks so much!

2024-05-29 10:48:14,271 INFO [jira_session] Connected to [address] on https://[studio].atlassian.net (JIRA Cloud)
2024-05-29 10:48:14,716 INFO [update_shotgun_users] Ensuring HumanUser.sg_jira_account_id exists.
2024-05-29 10:48:14,928 INFO [update_shotgun_users] Locating JIRA project [Jira Project Key]
2024-05-29 10:48:15,178 INFO [update_shotgun_users] Retrieving all Flow Production Tracking users
Traceback (most recent call last):
  File "C:\ProgramData\Flow-Production-Tracking-Jira-Bridge\sg-jira-bridge\update_shotgun_users.py", line 157, in <module>
  File "C:\ProgramData\Flow-Production-Tracking-Jira-Bridge\sg-jira-bridge\update_shotgun_users.py", line 151, in main
    sync_jira_users_into_shotgun(sg, jira, project)
  File "C:\ProgramData\Flow-Production-Tracking-Jira-Bridge\sg-jira-bridge\update_shotgun_users.py", line 73, in sync_jira_users_into_shotgun
    jira_user = jira.find_jira_assignee_for_issue(
  File "C:\ProgramData\Flow-Production-Tracking-Jira-Bridge\sg-jira-bridge\sg_jira\jira_session.py", line 242, in find_jira_assignee_for_issue
    return self.find_jira_user(
  File "C:\ProgramData\Flow-Production-Tracking-Jira-Bridge\sg-jira-bridge\sg_jira\jira_session.py", line 346, in find_jira_user
    jira_users = search_method(**search_params)
  File "C:\Python310\lib\site-packages\jira\client.py", line 3784, in search_assignable_users_for_issues
    return self._fetch_pages(
  File "C:\Python310\lib\site-packages\jira\client.py", line 808, in _fetch_pages
    page_params = json_params()
  File "C:\Python310\lib\site-packages\jira\client.py", line 806, in json_params
    return json.loads(json.dumps(params.copy())) if params else {}
  File "C:\Python310\lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "C:\Python310\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python310\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Python310\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Project is not JSON serializable

I’d print out what’s being serialized and check for signs of objects rather than dicts/strings.

Hey Patrick! Thanks so much for the quick reply. I’ll try this and report back with more info as soon as I can!

I tried adding some logger functions throughout update_shotgun_users.py, but they’re only reporting the string value of the Jira project key. I’m a little unclear on what the error is telling me, too. Do I need to make an adjustment to the Object at a high level, or does it want me to convert the value of the Object before /during a specific function. What do you think?

I discovered a potential error I was making, which is that I was passing the project “key” (letters) to the script instead of the project “id” (numbers). So, I tried running it with the id and got the same result.

It looks like the error is happening when it tries to retrieve Flow Production Tracking users, so maybe it’s not a Jira thing, maybe it’s a Flow thing. I will keep the thread updated, but I welcome any input or suggestions!

I got it working! I think I was operating off some old documentation. I followed the guide here, and now it’s working: https://help.autodesk.com/view/SGDEV/ENU/?guid=SGD_jb_jira_bridge_html