0
1

More than 3 years have passed since last update.

ShogunAPIからチケットを投稿する方法

Posted at

やりたい事

ShotgunAPIだけで画像のようなチケットを投稿したい。
image.png

コード

APIキーなどは各環境に合わせて変更してください。

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"テストチケットの投稿"
    }
sg_Ticket = _sg.create('Ticket', data)

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

_sg.create("Reply",sg_reply)

_sg.create('Ticket', data)からチケットを作成して、_sg.create("Reply",sg_reply)で詳細をリプライ形式で書き込んでいきます。

チケット作成には最低限プロジェクトの指定が必要です。
リプライは紐づける先となるチケットのIDが必要です。

結果

出来ました!
image.png

参考にしたもの

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1