[PYTHON] How to post a ticket from the Shogun API

What you want to do

I want to post a ticket like an image only with the Shotgun API. image.png

code

Please change the API key etc. according to each environment.

import shotgun_api3
SERVER_URL = 'https://tanuki.shotgunstudio.com'
SCRIPT_NAME = 'tanuki_API'
SCRIPT_KEY = 'hondotanuki'

_sg = shotgun_api3.Shotgun(SERVER_URL, SCRIPT_NAME, SCRIPT_KEY)
data = {
    'project':{"type"  : "Project","id" : 1},
    'title' : u"Posting a test ticket"
    }
sg_Ticket = _sg.create('Ticket', data)

sg_reply = {
                'entity':{
                    'type':'Ticket',
                    'id':sg_Ticket["id"]
                },
                'content':u"test"
}

_sg.create("Reply",sg_reply)

Create a ticket from _sg.create ('Ticket', data) and write the details in reply format with _sg.create ("Reply", sg_reply).

At a minimum, you need to specify a project to create a ticket. The reply requires the ID of the ticket to be linked.

result

it is complete! image.png

Referenced

https://support.shotgunsoftware.com/hc/ja/community/posts/209486248-Reply-Note-with-API-this-is-possible-

Recommended Posts

How to post a ticket from the Shogun API
How to create a clone from Github
How to get followers and followers from python using the Mastodon API
How to operate Linux from the console
How to extract the desired character string from a line 4 commands
How to create a repository from media
How to access the Datastore from the outside
How to send a request to the DMM (FANZA) API with python
From the introduction of GoogleCloudPlatform Natural Language API to how to use it
How to get a sample report from a hash value using VirusTotal's API
How to calculate the volatility of a brand
How to open a web browser from python
How to generate a Python object from JSON
How to call Cloud API from GCP Cloud Functions
How to use the Google Cloud Translation API
How to operate Linux from the outside Procedure
How to extract coefficients from a fractional formula
How to use the NHK program guide API
How to measure line speed from the terminal
How to create a Rest Api in Django
How to use shogun
[LINE Messaging API] I want to send a message from the program to everyone's LINE
Read the Python-Markdown source: How to create a parser
[Python] How to remove duplicate values from the list
How to create an article from the command line
How to write a GUI using the maya command
How to create a submenu with the [Blender] plugin
How to instantly launch Jupyter Notebook from the terminal
Post to your account using the API on Twitter
How to take a captured image from a video (OpenCV)
[Python] How to call a c function from python (ctypes)
How to create a kubernetes pod from python code
A little bit from Python using the Jenkins API
Post from Python to Slack
How to use the generator
How to call a function
How to hack a terminal
How to use the decorator
How to increase the axis
How to start the program
[Ubuntu] How to delete the entire contents of a directory
How to slice a block multiple array from a multiple array in Python
How to run a Python program from within a shell script
How to use the __call__ method in a Python class
How to launch AWS Batch from a python client app
How to generate a public key from an SSH private key
How to calculate the amount of calculation learned from ABC134-D
How to log in automatically like 1Password from the CLI
How to generate a query using the IN operator in Django
How to do the initial setup from Django project creation
How to hide your Google Maps API key from HTML
How to get the last (last) value in a list in Python
How to hit NAPALM from the Web (NetDevOpsSec reality solution)
A story about how to deal with the CORS problem
How to find the scaling factor of a biorthogonal wavelet
Road to the Wizard: Step 8 (Interpret How to become a Hacker)
How to get a list of links from a page from wikipedia
I tried to get various information from the codeforces API
How to connect the contents of a list into a string
Extract the value closest to a value from a Python list element
How to quickly count the frequency of appearance of characters from a character string in Python?