Rest APIを使用してプロジェクト内のゴールを取得する方法
ゴールプロジェクトIDの取得
GET https://app.userstorymap.io/smb/goal
プロジェクト内、またはプロジェクトリスト内のゴール一覧を返します。
ユーザーが閲覧可能なプロジェクト内のゴールのみを返します。
リクエスト
QUERY PARAMETERS
projectId string : The project ID goals
projectIds Array<string> : List project IDS. The parameter accepts a comma-separated list. Get all goals in this list projects
Ex: projectIds=10000,10001
Example
curl --location --request GET 'https://app.userstorymap.io/smb/goal?projectId=10001' \
--header 'Authorization: JWT <PLUGIN_TOKEN>'
2. プラグインapiのJWTを取得
POST https://your-domain.atlassian.net/plugins/servlet/ac/com.devsamurai.plugin.jira.story-mapping/main
Get plugin token api
まず、Jira token api を作成して取得する必要があります。 Atlassian guide
例: Jira トークンで api を呼び出してプラグイン トークンを取得する例
curl --location --request POST 'https://your-domain.atlassian.net/plugins/servlet/ac/com.devsamurai.plugin.jira.story-mapping/main' \
--header 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
--user 'email@example.com:<api_token>' \
--data-urlencode 'plugin-key=com.devsamurai.plugin.jira.story-mapping' \
--data-urlencode 'product-context={}' \
--data-urlencode 'classifier=json'
レスポンス
{
"addon_key": "com.devsamurai.plugin.jira.story-mapping",
"uniqueKey": "com.devsamurai.plugin.jira.story-mapping__main",
"key": "main",
"moduleType": "generalPages",
"moduleLocation": "system.top.navigation.bar",
"title": "Story Mapping Boards",
"cp": "",
"general": "1",
"w": "",
"h": "",
"url": "https://www.story-mapping.atlas.devsamurai.com/index.htm?xdm_e=https%3A%2F%2Fdevsamurai-stg.atlassian.net&xdm_c=channel-com.devsamurai.plugin.jira.story-mapping__main&cp=&xdm_deprecated_addon_key_do_not_use=com.devsamurai.plugin.jira.story-mapping&lic=active&cv=1001.0.0-SNAPSHOT&jwt=eyJ0eX...",
"contextJwt": "eyJ0eX...",
"structuredContext": "{\"license\":{\"active\":true}}",
"contentClassifier": "",
"productCtx": "{}",
"timeZone": "Asia/Saigon",
"origin": "https://www.story-mapping.atlas.devsamurai.com",
"hostOrigin": "https://your-domain.atlassian.net",
"sandbox": "allow-downloads allow-forms allow-modals allow-popups allow-scripts allow-same-origin allow-top-navigation-by-user-activation allow-storage-access-by-user-activation",
"apiMigrations": {
"gdpr": true
}
}
contextJwtプロパティでプラグイントークンを取得します。