Version from Deadline - modify Created By filed

Hi guys,

we are using custom script to publish version from Deadline to SG - this is working fine just in notification we have Script name instead of Artist name.
image

What i’m currently trying to do is put Artist name (sg code user) into Created By filed, but i can’t find any setting in SG for that - probably not the best way …
image

Can someone help me, or give me an idea where to look / how to solve it ?

Thank you

1 Like

Hi @marek_bires welcome to the forums!

To set the created by value, you need to pass the user entity to the created_by field in the create request:

# basic example where the "created by" user is set when creating a Version

# Find a SG user with a certain login name
user = sg.find_one("HumanUser", [["login","is","philip"]])
# >>{"type":"HumanUser", "id":88}

# Now create the Version and set the created by to be the found user
data = {'code': "Test Version",
        "project": {'type': 'Project', 'id': 89},
        "created_by": user}

version = sg.create("Version", data)
4 Likes

Hi @philip.scadding,

Thank you for reply, this works for me :slight_smile:
I just add “created_by”: to the create request, as you mention, but with the same attributes as we have for “user”:

1 Like