snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
This commit is contained in:
0
zerver/webhooks/jira/__init__.py
Normal file
0
zerver/webhooks/jira/__init__.py
Normal file
45
zerver/webhooks/jira/doc.md
Normal file
45
zerver/webhooks/jira/doc.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Zulip Jira integration
|
||||
|
||||
Get Zulip notifications for your Jira projects!
|
||||
|
||||
!!! tip ""
|
||||
|
||||
If you also configure a [custom profile
|
||||
field](/help/custom-profile-fields) for Atlassian Cloud account IDs,
|
||||
this integration will refer to Jira users using
|
||||
[Zulip silent mentions](/help/mention-a-user-or-group#silently-mention-a-user),
|
||||
rather than their Jira display name. See [how to find Atlassian
|
||||
account IDs][atlassian-account-id].
|
||||
|
||||
[atlassian-account-id]: https://developer.atlassian.com/cloud/automation/resources/how-to-get-user-account-IDs/
|
||||
|
||||
{start_tabs}
|
||||
|
||||
1. {!create-an-incoming-webhook.md!}
|
||||
|
||||
1. {!generate-webhook-url-basic.md!}
|
||||
|
||||
1. Go to your Jira **Site administration** page. Click on the menu icon
|
||||
( <i class="fa fa-ellipsis-h"></i> ) under **Actions** for your
|
||||
**Jira** product, and select **Jira settings**. In the left sidebar,
|
||||
scroll down, and under **Advanced**, click **WebHooks**. Click
|
||||
**+ Create a WebHook**.
|
||||
|
||||
1. Set **Name** to a name of your choice, such as `Zulip`. Set
|
||||
**Status** to **Enabled**, and set **URL** to the URL generated
|
||||
above. Select the [events](#filtering-incoming-events) you'd like
|
||||
to be notified about, and click **Create**.
|
||||
|
||||
{end_tabs}
|
||||
|
||||
{!congrats.md!}
|
||||
|
||||

|
||||
|
||||
{!event-filtering-additional-feature.md!}
|
||||
|
||||
### Related documentation
|
||||
|
||||
- [Jira's webhook guide](https://developer.atlassian.com/server/jira/platform/webhooks/)
|
||||
|
||||
{!webhooks-url-specification.md!}
|
||||
113
zerver/webhooks/jira/fixtures/comment_created.json
Normal file
113
zerver/webhooks/jira/fixtures/comment_created.json
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"timestamp": 1565964017153,
|
||||
"webhookEvent": "comment_created",
|
||||
"comment": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000/comment/10000",
|
||||
"id": "10000",
|
||||
"author": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"body": "This is a comment that likes to *exercise* a lot of _different_ {{conventions}} that {{jira uses}}.\r\n\r\n{noformat}\r\nthis code is not highlighted, but monospaced\r\n{noformat}\r\n\r\n{code:python}\r\ndef python():\r\n print \"likes to be formatted\"\r\n{code}\r\n\r\n[http://www.google.com] is a bare link, and [Google|http://www.google.com] is given a title.\r\n\r\nThanks!\r\n\r\n{quote}\r\nSomeone said somewhere\r\n{quote}\\!\n[~Niloth]\n[~King Hamlet]",
|
||||
"updateAuthor": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"created": "2019-08-16T19:30:17.153+0530",
|
||||
"updated": "2019-08-16T19:30:17.153+0530",
|
||||
"jsdPublic": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10000",
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000",
|
||||
"key": "SP-1",
|
||||
"fields": {
|
||||
"summary": "Add support for newer format Jira issue comment events",
|
||||
"issuetype": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issuetype/10100",
|
||||
"id": "10100",
|
||||
"description": "A task that needs to be done.",
|
||||
"iconUrl": "https://f20171170.atlassian.net/secure/viewavatar?size=medium&avatarId=10318&avatarType=issuetype",
|
||||
"name": "Task",
|
||||
"subtask": false,
|
||||
"avatarId": 10318,
|
||||
"entityId": "7781fe72-66c8-43f7-b4cb-ef2482548605"
|
||||
},
|
||||
"project": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "SP",
|
||||
"name": "Sample Project",
|
||||
"projectTypeKey": "software",
|
||||
"simplified": true,
|
||||
"avatarUrls": {
|
||||
"48x48": "https://f20171170.atlassian.net/secure/projectavatar?pid=10000&avatarId=10410",
|
||||
"24x24": "https://f20171170.atlassian.net/secure/projectavatar?size=small&s=small&pid=10000&avatarId=10410",
|
||||
"16x16": "https://f20171170.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10000&avatarId=10410",
|
||||
"32x32": "https://f20171170.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10000&avatarId=10410"
|
||||
}
|
||||
},
|
||||
"assignee": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"emailAddress": "f20171170@pilani.bits-pilani.ac.in",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"priority": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://f20171170.atlassian.net/images/icons/priorities/medium.svg",
|
||||
"name": "Medium",
|
||||
"id": "3"
|
||||
},
|
||||
"status": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/status/10000",
|
||||
"description": "",
|
||||
"iconUrl": "https://f20171170.atlassian.net/",
|
||||
"name": "To Do",
|
||||
"id": "10000",
|
||||
"statusCategory": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/statuscategory/2",
|
||||
"id": 2,
|
||||
"key": "new",
|
||||
"colorName": "blue-gray",
|
||||
"name": "To Do"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"timestamp": 1565964017153,
|
||||
"webhookEvent": "comment_created",
|
||||
"comment": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000/comment/12000",
|
||||
"id": "12000",
|
||||
"author": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"accountId": "99:b8d8a054-2e12-4839-bd5f-5f2b7c5f5e3a",
|
||||
"key": "admin",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta"
|
||||
},
|
||||
"body": "Sounds like it’s pretty important. I’ll get this fixed ASAP\\!",
|
||||
"updateAuthor": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"accountId": "99:b8d8a054-2e12-4839-bd5f-5f2b7c5f5e3a",
|
||||
"key": "admin",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta"
|
||||
},
|
||||
"created": "2019-08-16T19:30:17.153+0530",
|
||||
"updated": "2019-08-16T19:30:17.153+0530"
|
||||
}
|
||||
}
|
||||
113
zerver/webhooks/jira/fixtures/comment_deleted.json
Normal file
113
zerver/webhooks/jira/fixtures/comment_deleted.json
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"timestamp": 1565964144825,
|
||||
"webhookEvent": "comment_deleted",
|
||||
"comment": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000/comment/10000",
|
||||
"id": "10000",
|
||||
"author": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"body": "This is a very important issue\\! I’m on it\\!",
|
||||
"updateAuthor": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"created": "2019-08-16T19:30:17.153+0530",
|
||||
"updated": "2019-08-16T19:31:43.489+0530",
|
||||
"jsdPublic": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10000",
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000",
|
||||
"key": "SP-1",
|
||||
"fields": {
|
||||
"summary": "Add support for newer format Jira issue comment events",
|
||||
"issuetype": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issuetype/10100",
|
||||
"id": "10100",
|
||||
"description": "A task that needs to be done.",
|
||||
"iconUrl": "https://f20171170.atlassian.net/secure/viewavatar?size=medium&avatarId=10318&avatarType=issuetype",
|
||||
"name": "Task",
|
||||
"subtask": false,
|
||||
"avatarId": 10318,
|
||||
"entityId": "7781fe72-66c8-43f7-b4cb-ef2482548605"
|
||||
},
|
||||
"project": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "SP",
|
||||
"name": "Sample Project",
|
||||
"projectTypeKey": "software",
|
||||
"simplified": true,
|
||||
"avatarUrls": {
|
||||
"48x48": "https://f20171170.atlassian.net/secure/projectavatar?pid=10000&avatarId=10410",
|
||||
"24x24": "https://f20171170.atlassian.net/secure/projectavatar?size=small&s=small&pid=10000&avatarId=10410",
|
||||
"16x16": "https://f20171170.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10000&avatarId=10410",
|
||||
"32x32": "https://f20171170.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10000&avatarId=10410"
|
||||
}
|
||||
},
|
||||
"assignee": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"emailAddress": "f20171170@pilani.bits-pilani.ac.in",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"priority": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://f20171170.atlassian.net/images/icons/priorities/medium.svg",
|
||||
"name": "Medium",
|
||||
"id": "3"
|
||||
},
|
||||
"status": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/status/10000",
|
||||
"description": "",
|
||||
"iconUrl": "https://f20171170.atlassian.net/",
|
||||
"name": "To Do",
|
||||
"id": "10000",
|
||||
"statusCategory": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/statuscategory/2",
|
||||
"id": 2,
|
||||
"key": "new",
|
||||
"colorName": "blue-gray",
|
||||
"name": "To Do"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
113
zerver/webhooks/jira/fixtures/comment_updated.json
Normal file
113
zerver/webhooks/jira/fixtures/comment_updated.json
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"timestamp": 1565964103489,
|
||||
"webhookEvent": "comment_updated",
|
||||
"comment": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000/comment/10000",
|
||||
"id": "10000",
|
||||
"author": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"body": "This is a very important issue\\! I’m on it\\!",
|
||||
"updateAuthor": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"created": "2019-08-16T19:30:17.153+0530",
|
||||
"updated": "2019-08-16T19:31:43.489+0530",
|
||||
"jsdPublic": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10000",
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issue/10000",
|
||||
"key": "SP-1",
|
||||
"fields": {
|
||||
"summary": "Add support for newer format Jira issue comment events",
|
||||
"issuetype": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/issuetype/10100",
|
||||
"id": "10100",
|
||||
"description": "A task that needs to be done.",
|
||||
"iconUrl": "https://f20171170.atlassian.net/secure/viewavatar?size=medium&avatarId=10318&avatarType=issuetype",
|
||||
"name": "Task",
|
||||
"subtask": false,
|
||||
"avatarId": 10318,
|
||||
"entityId": "7781fe72-66c8-43f7-b4cb-ef2482548605"
|
||||
},
|
||||
"project": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "SP",
|
||||
"name": "Sample Project",
|
||||
"projectTypeKey": "software",
|
||||
"simplified": true,
|
||||
"avatarUrls": {
|
||||
"48x48": "https://f20171170.atlassian.net/secure/projectavatar?pid=10000&avatarId=10410",
|
||||
"24x24": "https://f20171170.atlassian.net/secure/projectavatar?size=small&s=small&pid=10000&avatarId=10410",
|
||||
"16x16": "https://f20171170.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10000&avatarId=10410",
|
||||
"32x32": "https://f20171170.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10000&avatarId=10410"
|
||||
}
|
||||
},
|
||||
"assignee": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/user?accountId=5c76b994e1bcdf6294d0eb0f",
|
||||
"name": "admin",
|
||||
"key": "admin",
|
||||
"accountId": "5c76b994e1bcdf6294d0eb0f",
|
||||
"emailAddress": "f20171170@pilani.bits-pilani.ac.in",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=48&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=24&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=16&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/bc3f74559ceceb488f4189b7e7bdfec2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHA-1.png&size=32&s=32"
|
||||
},
|
||||
"displayName": "Hemanth V. Alluri",
|
||||
"active": true,
|
||||
"timeZone": "Asia/Calcutta",
|
||||
"accountType": "atlassian"
|
||||
},
|
||||
"priority": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://f20171170.atlassian.net/images/icons/priorities/medium.svg",
|
||||
"name": "Medium",
|
||||
"id": "3"
|
||||
},
|
||||
"status": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/status/10000",
|
||||
"description": "",
|
||||
"iconUrl": "https://f20171170.atlassian.net/",
|
||||
"name": "To Do",
|
||||
"id": "10000",
|
||||
"statusCategory": {
|
||||
"self": "https://f20171170.atlassian.net/rest/api/2/statuscategory/2",
|
||||
"id": 2,
|
||||
"key": "new",
|
||||
"colorName": "blue-gray",
|
||||
"name": "To Do"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"accountId": "1234asdfjlsweoiruoso",
|
||||
"username": "eeshangarg"
|
||||
}
|
||||
123
zerver/webhooks/jira/fixtures/issue_created.json
Normal file
123
zerver/webhooks/jira/fixtures/issue_created.json
Normal file
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_created",
|
||||
"issue_event_type_name":"issue_created",
|
||||
"timestamp": 1364403238369,
|
||||
"user": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10400",
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400",
|
||||
"key": "BUG-15",
|
||||
"fields": {
|
||||
"summary": "New bug with hook",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issuetype/1",
|
||||
"id": "1",
|
||||
"description": "A problem which impairs or prevents the functions of the product.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/bug.gif",
|
||||
"name": "Bug",
|
||||
"subtask": false
|
||||
},
|
||||
"votes": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"resolution": null,
|
||||
"fixVersions": [],
|
||||
"resolutiondate": null,
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"created": "2013-03-27T16:53:58.301+0000",
|
||||
"updated": "2013-03-27T16:53:58.301+0000",
|
||||
"description": "Fix me please",
|
||||
"priority": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/priority/3",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/priority_major.gif",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"duedate": null,
|
||||
"issuelinks": [],
|
||||
"watches": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/watchers",
|
||||
"watchCount": 0,
|
||||
"isWatching": false
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"status": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/status/1",
|
||||
"description": "The issue is open and ready for the assignee to start work on it.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/status_open.gif",
|
||||
"name": "Open",
|
||||
"id": "1"
|
||||
},
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"assignee": null,
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"project": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/project/BUG",
|
||||
"id": "10000",
|
||||
"key": "BUG",
|
||||
"name": "buggery-test",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"48x48": "http://lfranchi.com:8080/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"versions": [],
|
||||
"environment": null,
|
||||
"timeestimate": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"lastViewed": null,
|
||||
"components": [],
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"comments": []
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
}
|
||||
}
|
||||
158
zerver/webhooks/jira/fixtures/issue_created_with_assignee.json
Normal file
158
zerver/webhooks/jira/fixtures/issue_created_with_assignee.json
Normal file
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_created",
|
||||
"issue_event_type_name":"issue_created",
|
||||
"user": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=bwilliams",
|
||||
"name": "bwilliams",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "bwilliams@example.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Bo Williams",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10003",
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/10003",
|
||||
"key": "TEST-4",
|
||||
"fields": {
|
||||
"summary": "Test Created Assignee",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issuetype/2",
|
||||
"id": "2",
|
||||
"description": "A new feature of the product, which has yet to be developed.",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/issuetypes/newfeature.png",
|
||||
"name": "New Feature",
|
||||
"subtask": false
|
||||
},
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=bwilliams",
|
||||
"name": "bwilliams",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "bwilliams@example.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Bo Williams",
|
||||
"active": true
|
||||
},
|
||||
"created": "2013-09-06T11:20:24.101-0400",
|
||||
"updated": "2013-09-06T11:20:24.101-0400",
|
||||
"priority": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/priorities/major.png",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"description": "This is the description, so descriptive it is",
|
||||
"customfield_10001": null,
|
||||
"customfield_10002": null,
|
||||
"customfield_10003": null,
|
||||
"issuelinks": [],
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"customfield_10008": null,
|
||||
"customfield_10007": null,
|
||||
"status": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/status/10001",
|
||||
"description": "",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/statuses/open.png",
|
||||
"name": "To Do",
|
||||
"id": "10001"
|
||||
},
|
||||
"customfield_10006": "4",
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"project": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "TEST",
|
||||
"name": "TestProject",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/projectavatar?size=xsmall&pid=10000&avatarId=10011",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/projectavatar?size=medium&pid=10000&avatarId=10011",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"environment": null,
|
||||
"customfield_10014": null,
|
||||
"customfield_10015": null,
|
||||
"lastViewed": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"customfield_10012": null,
|
||||
"components": [],
|
||||
"customfield_10013": null,
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"comments": []
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"customfield_10017": null,
|
||||
"customfield_10016": null,
|
||||
"customfield_10019": null,
|
||||
"customfield_10018": null,
|
||||
"votes": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-4/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"fixVersions": [],
|
||||
"resolution": null,
|
||||
"resolutiondate": null,
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"duedate": null,
|
||||
"customfield_10020": null,
|
||||
"customfield_10021": "Not Started",
|
||||
"watches": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-4/watchers",
|
||||
"watchCount": 0,
|
||||
"isWatching": false
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 20,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"assignee": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=klin",
|
||||
"name": "klin",
|
||||
"accountId": "99:a5b6c7d8-9012-4e3f-8b7a-1c2d3e4f5a6b",
|
||||
"emailAddress": "klin@example.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Kevin Lin",
|
||||
"active": true
|
||||
},
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"versions": [],
|
||||
"timeestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
},
|
||||
"timestamp": 1378480824183
|
||||
}
|
||||
123
zerver/webhooks/jira/fixtures/issue_created_with_unicode.json
Normal file
123
zerver/webhooks/jira/fixtures/issue_created_with_unicode.json
Normal file
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_created",
|
||||
"issue_event_type_name":"issue_created",
|
||||
"timestamp": 1364403238369,
|
||||
"user": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchià",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10400",
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400",
|
||||
"key": "BUG-15",
|
||||
"fields": {
|
||||
"summary": "New bug with à hook",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issuetype/1",
|
||||
"id": "1",
|
||||
"description": "A problem which impairs or prevents the functions of the product.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/bug.gif",
|
||||
"name": "Bug",
|
||||
"subtask": false
|
||||
},
|
||||
"votes": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"resolution": null,
|
||||
"fixVersions": [],
|
||||
"resolutiondate": null,
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"created": "2013-03-27T16:53:58.301+0000",
|
||||
"updated": "2013-03-27T16:53:58.301+0000",
|
||||
"description": "Fix me please",
|
||||
"priority": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/priority/3",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/priority_major.gif",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"duedate": null,
|
||||
"issuelinks": [],
|
||||
"watches": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/watchers",
|
||||
"watchCount": 0,
|
||||
"isWatching": false
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"status": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/status/1",
|
||||
"description": "The issue is open and ready for the assignee to start work on it.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/status_open.gif",
|
||||
"name": "Open",
|
||||
"id": "1"
|
||||
},
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"assignee": null,
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"project": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/project/BUG",
|
||||
"id": "10000",
|
||||
"key": "BUG",
|
||||
"name": "buggery-test",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"48x48": "http://lfranchi.com:8080/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"versions": [],
|
||||
"environment": null,
|
||||
"timeestimate": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"lastViewed": null,
|
||||
"components": [],
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"comments": []
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
}
|
||||
}
|
||||
166
zerver/webhooks/jira/fixtures/issue_deleted.json
Normal file
166
zerver/webhooks/jira/fixtures/issue_deleted.json
Normal file
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_deleted",
|
||||
"issue_event_type_name":"issue_deleted",
|
||||
"timestamp": 1364403969102,
|
||||
"user": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10400",
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400",
|
||||
"key": "BUG-15",
|
||||
"fields": {
|
||||
"summary": "New bug with hook",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issuetype/1",
|
||||
"id": "1",
|
||||
"description": "A problem which impairs or prevents the functions of the product.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/bug.gif",
|
||||
"name": "Bug",
|
||||
"subtask": false
|
||||
},
|
||||
"votes": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"resolution": null,
|
||||
"fixVersions": [],
|
||||
"resolutiondate": null,
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"created": "2013-03-27T16:53:58.301+0000",
|
||||
"updated": "2013-03-27T17:05:34.250+0000",
|
||||
"description": "Fix me please",
|
||||
"priority": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/priority/3",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/priority_major.gif",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"duedate": null,
|
||||
"issuelinks": [],
|
||||
"watches": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/watchers",
|
||||
"watchCount": 1,
|
||||
"isWatching": true
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"status": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/status/1",
|
||||
"description": "The issue is open and ready for the assignee to start work on it.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/status_open.gif",
|
||||
"name": "Open",
|
||||
"id": "1"
|
||||
},
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"assignee": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"project": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/project/BUG",
|
||||
"id": "10000",
|
||||
"key": "BUG",
|
||||
"name": "buggery-test",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"48x48": "http://lfranchi.com:8080/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"versions": [],
|
||||
"environment": null,
|
||||
"timeestimate": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"lastViewed": "2013-03-27T17:06:09.088+0000",
|
||||
"components": [],
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 1,
|
||||
"total": 1,
|
||||
"comments": [
|
||||
{
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400/comment/10400",
|
||||
"id": "10400",
|
||||
"author": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"body": "Adding a comment. Oh, what a comment it is!",
|
||||
"updateAuthor": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"created": "2013-03-27T17:05:34.250+0000",
|
||||
"updated": "2013-03-27T17:05:34.250+0000"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
}
|
||||
}
|
||||
197
zerver/webhooks/jira/fixtures/issue_unknown.json
Normal file
197
zerver/webhooks/jira/fixtures/issue_unknown.json
Normal file
@@ -0,0 +1,197 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_unknown",
|
||||
"issue_event_type_name":"issue_unknown",
|
||||
"timestamp": 1364403934253,
|
||||
"user": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10400",
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400",
|
||||
"key": "BUG-15",
|
||||
"fields": {
|
||||
"summary": "New bug with hook",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issuetype/1",
|
||||
"id": "1",
|
||||
"description": "A problem which impairs or prevents the functions of the product.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/bug.gif",
|
||||
"name": "Bug",
|
||||
"subtask": false
|
||||
},
|
||||
"votes": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"resolution": null,
|
||||
"fixVersions": [],
|
||||
"resolutiondate": null,
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"created": "2013-03-27T16:53:58.301+0000",
|
||||
"updated": "2013-03-27T16:57:45.287+0000",
|
||||
"description": "Fix me please",
|
||||
"priority": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/priority/3",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/priority_major.gif",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"duedate": null,
|
||||
"issuelinks": [],
|
||||
"watches": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/watchers",
|
||||
"watchCount": 1,
|
||||
"isWatching": true
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"status": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/status/1",
|
||||
"description": "The issue is open and ready for the assignee to start work on it.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/status_open.gif",
|
||||
"name": "Open",
|
||||
"id": "1"
|
||||
},
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"assignee": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"project": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/project/BUG",
|
||||
"id": "10000",
|
||||
"key": "BUG",
|
||||
"name": "buggery-test",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"48x48": "http://lfranchi.com:8080/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"versions": [],
|
||||
"environment": null,
|
||||
"timeestimate": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"lastViewed": "2013-03-27T16:57:45.258+0000",
|
||||
"components": [],
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 1,
|
||||
"total": 1,
|
||||
"comments": [
|
||||
{
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400/comment/10400",
|
||||
"id": "10400",
|
||||
"author": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"body": "Adding a comment. Oh, what a comment it is!",
|
||||
"updateAuthor": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"created": "2013-03-27T17:05:34.250+0000",
|
||||
"updated": "2013-03-27T17:05:34.250+0000"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
},
|
||||
"comment": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400/comment/10400",
|
||||
"id": "10400",
|
||||
"author": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"body": "Adding a comment. Oh, what a comment it is!",
|
||||
"updateAuthor": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"created": "2013-03-27T17:05:34.250+0000",
|
||||
"updated": "2013-03-27T17:05:34.250+0000"
|
||||
}
|
||||
}
|
||||
228
zerver/webhooks/jira/fixtures/issue_updated__priority.json
Normal file
228
zerver/webhooks/jira/fixtures/issue_updated__priority.json
Normal file
@@ -0,0 +1,228 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_updated",
|
||||
"issue_event_type_name":"issue_updated",
|
||||
"user": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10000",
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/10000",
|
||||
"key": "TEST-1",
|
||||
"fields": {
|
||||
"summary": "Fix That",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issuetype/2",
|
||||
"id": "2",
|
||||
"description": "A new feature of the product, which has yet to be developed.",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/issuetypes/newfeature.png",
|
||||
"name": "New Feature",
|
||||
"subtask": false
|
||||
},
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"created": "2013-09-06T11:07:19.972-0400",
|
||||
"updated": "2014-02-26T14:57:13.139-0500",
|
||||
"priority": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/priorities/major.png",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"description": "Please",
|
||||
"customfield_10001": null,
|
||||
"customfield_10002": null,
|
||||
"customfield_10003": null,
|
||||
"issuelinks": [],
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"customfield_10008": null,
|
||||
"customfield_10007": null,
|
||||
"status": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/status/10001",
|
||||
"description": "",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/statuses/open.png",
|
||||
"name": "To Do",
|
||||
"id": "10001",
|
||||
"statusCategory": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/statuscategory/2",
|
||||
"id": 2,
|
||||
"key": "new",
|
||||
"colorName": "blue-gray",
|
||||
"name": "New"
|
||||
}
|
||||
},
|
||||
"customfield_10006": "1",
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"project": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "TEST",
|
||||
"name": "TestProject",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/projectavatar?size=xsmall&pid=10000&avatarId=10011",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/projectavatar?size=medium&pid=10000&avatarId=10011",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"environment": null,
|
||||
"customfield_10014": null,
|
||||
"customfield_10015": null,
|
||||
"lastViewed": "2014-02-26T14:56:59.145-0500",
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"customfield_10012": null,
|
||||
"components": [],
|
||||
"customfield_10013": null,
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 1,
|
||||
"total": 1,
|
||||
"comments": [
|
||||
{
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/10000/comment/10100",
|
||||
"id": "10100",
|
||||
"author": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"body": "test",
|
||||
"updateAuthor": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"created": "2014-02-26T14:55:10.416-0500",
|
||||
"updated": "2014-02-26T14:55:10.416-0500"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"customfield_10017": null,
|
||||
"customfield_10016": null,
|
||||
"customfield_10019": null,
|
||||
"customfield_10018": null,
|
||||
"votes": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-1/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"fixVersions": [],
|
||||
"resolution": null,
|
||||
"resolutiondate": null,
|
||||
"creator": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"duedate": null,
|
||||
"customfield_10020": null,
|
||||
"customfield_10021": "Not Started",
|
||||
"watches": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-1/watchers",
|
||||
"watchCount": 1,
|
||||
"isWatching": true
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 20,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"assignee": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=leo",
|
||||
"name": "leo",
|
||||
"accountId": "99:e2f12cf6-839d-4ea2-ae07-e1a59cb009c8",
|
||||
"emailAddress": "leo@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "https://zulipp.atlassian.net/secure/useravatar?size=xsmall&avatarId=10122",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/useravatar?size=small&avatarId=10122",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/useravatar?size=medium&avatarId=10122",
|
||||
"48x48": "https://zulipp.atlassian.net/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true
|
||||
},
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"versions": [],
|
||||
"timeestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
},
|
||||
"changelog": {
|
||||
"id": "10102",
|
||||
"items": [
|
||||
{
|
||||
"field": "priority",
|
||||
"fieldtype": "jira",
|
||||
"from": "2",
|
||||
"fromString": "Critical",
|
||||
"to": "3",
|
||||
"toString": "Major"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timestamp": 1393444633145
|
||||
}
|
||||
147
zerver/webhooks/jira/fixtures/issue_updated__reassigned.json
Normal file
147
zerver/webhooks/jira/fixtures/issue_updated__reassigned.json
Normal file
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"webhookEvent": "jira:issue_updated",
|
||||
"issue_event_type_name":"issue_generic",
|
||||
"timestamp": 1364403465325,
|
||||
"user": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"issue": {
|
||||
"id": "10400",
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/10400",
|
||||
"key": "BUG-15",
|
||||
"fields": {
|
||||
"summary": "New bug with hook",
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"timetracking": {},
|
||||
"issuetype": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issuetype/1",
|
||||
"id": "1",
|
||||
"description": "A problem which impairs or prevents the functions of the product.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/bug.gif",
|
||||
"name": "Bug",
|
||||
"subtask": false
|
||||
},
|
||||
"votes": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"resolution": null,
|
||||
"fixVersions": [],
|
||||
"resolutiondate": null,
|
||||
"timespent": null,
|
||||
"reporter": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"created": "2013-03-27T16:53:58.301+0000",
|
||||
"updated": "2013-03-27T16:57:45.287+0000",
|
||||
"description": "Fix me please",
|
||||
"priority": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/priority/3",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/priority_major.gif",
|
||||
"name": "Major",
|
||||
"id": "3"
|
||||
},
|
||||
"duedate": null,
|
||||
"issuelinks": [],
|
||||
"watches": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/issue/BUG-15/watchers",
|
||||
"watchCount": 1,
|
||||
"isWatching": true
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
},
|
||||
"customfield_10000": null,
|
||||
"subtasks": [],
|
||||
"status": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/status/1",
|
||||
"description": "The issue is open and ready for the assignee to start work on it.",
|
||||
"iconUrl": "http://lfranchi.com:8080/images/icons/status_open.gif",
|
||||
"name": "Open",
|
||||
"id": "1"
|
||||
},
|
||||
"labels": [],
|
||||
"workratio": -1,
|
||||
"assignee": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/user?username=lfranchi",
|
||||
"name": "lfranchi",
|
||||
"accountId": "99:27935d01-92a7-4687-8272-a9b8d3b2ae2e",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/useravatar?size=small&avatarId=10122",
|
||||
"48x48": "http://lfranchi.com:8080/secure/useravatar?avatarId=10122"
|
||||
},
|
||||
"displayName": "Leo Franchi",
|
||||
"active": true
|
||||
},
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"project": {
|
||||
"self": "http://lfranchi.com:8080/rest/api/2/project/BUG",
|
||||
"id": "10000",
|
||||
"key": "BUG",
|
||||
"name": "buggery-test",
|
||||
"avatarUrls": {
|
||||
"16x16": "http://lfranchi.com:8080/secure/projectavatar?size=small&pid=10000&avatarId=10011",
|
||||
"48x48": "http://lfranchi.com:8080/secure/projectavatar?pid=10000&avatarId=10011"
|
||||
}
|
||||
},
|
||||
"versions": [],
|
||||
"environment": null,
|
||||
"timeestimate": null,
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"lastViewed": "2013-03-27T16:57:45.258+0000",
|
||||
"components": [],
|
||||
"comment": {
|
||||
"startAt": 0,
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"comments": []
|
||||
},
|
||||
"timeoriginalestimate": null,
|
||||
"aggregatetimespent": null
|
||||
}
|
||||
},
|
||||
"changelog": {
|
||||
"id": "10600",
|
||||
"items": [
|
||||
{
|
||||
"field": "assignee",
|
||||
"fieldtype": "jira",
|
||||
"from": null,
|
||||
"fromString": null,
|
||||
"to": "lfranchi",
|
||||
"toString": "Leo Franchi"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
189
zerver/webhooks/jira/fixtures/issue_updated__status.json
Normal file
189
zerver/webhooks/jira/fixtures/issue_updated__status.json
Normal file
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"timestamp": 1485797534721,
|
||||
"webhookEvent": "jira:issue_updated",
|
||||
"issue_event_type_name": "issue_generic",
|
||||
"user": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=admin",
|
||||
"name": "admin",
|
||||
"accountId": "99:b8d8a054-2e12-4839-bd5f-5f2b7c5f5e3a",
|
||||
"key": "admin",
|
||||
"emailAddress": "othello@zulip.com",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=32"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true,
|
||||
"timeZone": "Europe/Berlin"
|
||||
},
|
||||
"issue": {
|
||||
"id": "10000",
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/10000",
|
||||
"key": "TEST-1",
|
||||
"fields": {
|
||||
"issuetype": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issuetype/10101",
|
||||
"id": "10101",
|
||||
"description": "A task that needs to be done.",
|
||||
"iconUrl": "https://zulipp.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype",
|
||||
"name": "Task",
|
||||
"subtask": false,
|
||||
"avatarId": 10318
|
||||
},
|
||||
"timespent": null,
|
||||
"project": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/project/10000",
|
||||
"id": "10000",
|
||||
"key": "ABC",
|
||||
"name": "Fix That",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://zulipp.atlassian.net/secure/projectavatar?avatarId=10324",
|
||||
"24x24": "https://zulipp.atlassian.net/secure/projectavatar?size=small&avatarId=10324",
|
||||
"16x16": "https://zulipp.atlassian.net/secure/projectavatar?size=xsmall&avatarId=10324",
|
||||
"32x32": "https://zulipp.atlassian.net/secure/projectavatar?size=medium&avatarId=10324"
|
||||
}
|
||||
},
|
||||
"fixVersions": [],
|
||||
"customfield_10110": null,
|
||||
"customfield_10111": null,
|
||||
"aggregatetimespent": null,
|
||||
"resolution": null,
|
||||
"customfield_10112": "Not started",
|
||||
"customfield_10113": null,
|
||||
"customfield_10114": null,
|
||||
"customfield_10104": null,
|
||||
"customfield_10105": null,
|
||||
"customfield_10106": null,
|
||||
"customfield_10107": null,
|
||||
"customfield_10108": null,
|
||||
"customfield_10109": null,
|
||||
"resolutiondate": null,
|
||||
"workratio": -1,
|
||||
"lastViewed": "2017-01-30T18:32:14.694+0100",
|
||||
"watches": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-1/watchers",
|
||||
"watchCount": 1,
|
||||
"isWatching": true
|
||||
},
|
||||
"created": "2017-01-30T18:30:41.962+0100",
|
||||
"priority": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/priority/3",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/priorities/medium.svg",
|
||||
"name": "Medium",
|
||||
"id": "3"
|
||||
},
|
||||
"customfield_10100": null,
|
||||
"customfield_10101": null,
|
||||
"customfield_10102": null,
|
||||
"labels": [],
|
||||
"customfield_10103": null,
|
||||
"timeestimate": null,
|
||||
"aggregatetimeoriginalestimate": null,
|
||||
"versions": [],
|
||||
"issuelinks": [],
|
||||
"assignee": null,
|
||||
"updated": "2017-01-30T18:32:14.716+0100",
|
||||
"status": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/status/3",
|
||||
"description": "This issue is being actively worked on at the moment by the assignee.",
|
||||
"iconUrl": "https://zulipp.atlassian.net/images/icons/statuses/inprogress.png",
|
||||
"name": "In Progress",
|
||||
"id": "3",
|
||||
"statusCategory": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/statuscategory/4",
|
||||
"id": 4,
|
||||
"key": "indeterminate",
|
||||
"colorName": "yellow",
|
||||
"name": "In Progress"
|
||||
}
|
||||
},
|
||||
"components": [],
|
||||
"timeoriginalestimate": null,
|
||||
"description": "Fix That",
|
||||
"timetracking": {},
|
||||
"customfield_10005": null,
|
||||
"attachment": [],
|
||||
"aggregatetimeestimate": null,
|
||||
"summary": "Fix That",
|
||||
"creator": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=admin",
|
||||
"name": "admin",
|
||||
"accountId": "99:b8d8a054-2e12-4839-bd5f-5f2b7c5f5e3a",
|
||||
"key": "admin",
|
||||
"emailAddress": "kolaszek@tlen.pl",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=32"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true,
|
||||
"timeZone": "Europe/Berlin"
|
||||
},
|
||||
"subtasks": [],
|
||||
"reporter": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/user?username=admin",
|
||||
"name": "admin",
|
||||
"accountId": "99:b8d8a054-2e12-4839-bd5f-5f2b7c5f5e3a",
|
||||
"key": "admin",
|
||||
"emailAddress": "kolaszek@tlen.pl",
|
||||
"avatarUrls": {
|
||||
"48x48": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=48",
|
||||
"24x24": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=24",
|
||||
"16x16": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=16",
|
||||
"32x32": "https://secure.gravatar.com/avatar/d832c4f48fb6bc323411fbbcd25079ad?d=mm&s=32"
|
||||
},
|
||||
"displayName": "Leonardo Franchi [Administrator]",
|
||||
"active": true,
|
||||
"timeZone": "Europe/Berlin"
|
||||
},
|
||||
"customfield_10000": "{}",
|
||||
"aggregateprogress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"customfield_10001": null,
|
||||
"customfield_10115": null,
|
||||
"customfield_10116": "0|hzzzzz:",
|
||||
"environment": null,
|
||||
"duedate": null,
|
||||
"progress": {
|
||||
"progress": 0,
|
||||
"total": 0
|
||||
},
|
||||
"comment": {
|
||||
"comments": [],
|
||||
"maxResults": 0,
|
||||
"total": 0,
|
||||
"startAt": 0
|
||||
},
|
||||
"votes": {
|
||||
"self": "https://zulipp.atlassian.net/rest/api/2/issue/TEST-1/votes",
|
||||
"votes": 0,
|
||||
"hasVoted": false
|
||||
},
|
||||
"worklog": {
|
||||
"startAt": 0,
|
||||
"maxResults": 20,
|
||||
"total": 0,
|
||||
"worklogs": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"changelog": {
|
||||
"id": "10000",
|
||||
"items": [
|
||||
{
|
||||
"field": "status",
|
||||
"fieldtype": "jira",
|
||||
"from": "10000",
|
||||
"fromString": "To Do",
|
||||
"to": "3",
|
||||
"toString": "In Progress"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
141
zerver/webhooks/jira/tests.py
Normal file
141
zerver/webhooks/jira/tests.py
Normal file
@@ -0,0 +1,141 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from zerver.actions.custom_profile_fields import try_add_realm_default_custom_profile_field
|
||||
from zerver.lib.test_classes import WebhookTestCase
|
||||
from zerver.models.realms import get_realm
|
||||
|
||||
|
||||
class JiraHookTests(WebhookTestCase):
|
||||
def test_custom_channel(self) -> None:
|
||||
api_key = self.test_user.api_key
|
||||
self.subscribe(self.test_user, "jira_custom")
|
||||
url = f"/api/v1/external/jira?api_key={api_key}&stream=jira_custom"
|
||||
msg = self.send_webhook_payload(
|
||||
self.test_user,
|
||||
url,
|
||||
self.get_body("issue_created"),
|
||||
content_type="application/json",
|
||||
)
|
||||
expected_content = "@_**Othello, the Moor of Venice|12** created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) with major priority."
|
||||
self.assert_channel_message(
|
||||
message=msg,
|
||||
channel_name="jira_custom",
|
||||
topic_name="BUG-15: New bug with hook",
|
||||
content=expected_content,
|
||||
)
|
||||
|
||||
def test_created(self) -> None:
|
||||
expected_topic_name = "BUG-15: New bug with hook"
|
||||
expected_message = "@_**Othello, the Moor of Venice|12** created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) with major priority."
|
||||
self.check_webhook("issue_created", expected_topic_name, expected_message)
|
||||
|
||||
def test_ignored_events(self) -> None:
|
||||
ignored_actions = [
|
||||
"attachment_created",
|
||||
"issuelink_created",
|
||||
"issuelink_deleted",
|
||||
"jira:version_released",
|
||||
"jira:worklog_updated",
|
||||
"sprint_closed",
|
||||
"sprint_started",
|
||||
"worklog_created",
|
||||
"worklog_updated",
|
||||
]
|
||||
for action in ignored_actions:
|
||||
url = self.build_webhook_url()
|
||||
payload = dict(webhookEvent=action)
|
||||
with patch("zerver.webhooks.jira.view.check_send_webhook_message") as m:
|
||||
result = self.client_post(url, payload, content_type="application/json")
|
||||
self.assertFalse(m.called)
|
||||
self.assert_json_success(result)
|
||||
|
||||
def test_created_with_unicode(self) -> None:
|
||||
expected_topic_name = "BUG-15: New bug with à hook"
|
||||
expected_message = "@_**Othello, the Moor of Venice|12** created [BUG-15: New bug with à hook](http://lfranchi.com:8080/browse/BUG-15) with major priority."
|
||||
self.check_webhook("issue_created_with_unicode", expected_topic_name, expected_message)
|
||||
|
||||
def test_created_assignee(self) -> None:
|
||||
expected_topic_name = "TEST-4: Test Created Assignee"
|
||||
expected_message = "Bo Williams created [TEST-4: Test Created Assignee](https://zulipp.atlassian.net/browse/TEST-4) with major priority (assigned to Kevin Lin)."
|
||||
self.check_webhook("issue_created_with_assignee", expected_topic_name, expected_message)
|
||||
|
||||
def test_deleted(self) -> None:
|
||||
expected_topic_name = "BUG-15: New bug with hook"
|
||||
expected_message = "@_**Othello, the Moor of Venice|12** deleted [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15)."
|
||||
self.check_webhook("issue_deleted", expected_topic_name, expected_message)
|
||||
|
||||
def test_reassigned(self) -> None:
|
||||
expected_topic_name = "BUG-15: New bug with hook"
|
||||
expected_message = """@_**Othello, the Moor of Venice|12** updated [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) (assigned to @_**Othello, the Moor of Venice|12**):
|
||||
|
||||
* Changed assignee to @_**Othello, the Moor of Venice|12**"""
|
||||
self.check_webhook("issue_updated__reassigned", expected_topic_name, expected_message)
|
||||
|
||||
def test_priority_updated(self) -> None:
|
||||
expected_topic_name = "TEST-1: Fix That"
|
||||
expected_message = """Leonardo Franchi [Administrator] updated [TEST-1: Fix That](https://zulipp.atlassian.net/browse/TEST-1) (assigned to Leonardo Franchi [Administrator]):
|
||||
|
||||
* Changed priority from **Critical** to **Major**"""
|
||||
self.check_webhook("issue_updated__priority", expected_topic_name, expected_message)
|
||||
|
||||
def test_status_changed(self) -> None:
|
||||
expected_topic_name = "TEST-1: Fix That"
|
||||
expected_message = """@_**Othello, the Moor of Venice|12** updated [TEST-1: Fix That](https://zulipp.atlassian.net/browse/TEST-1):
|
||||
|
||||
* Changed status from **To Do** to **In Progress**"""
|
||||
self.check_webhook("issue_updated__status", expected_topic_name, expected_message)
|
||||
|
||||
def test_comment_created(self) -> None:
|
||||
expected_topic_name = "SP-1: Add support for newer format Jira issue comment events"
|
||||
expected_message = """Hemanth V. Alluri commented on [SP-1: Add support for newer format Jira issue comment events](https://f20171170.atlassian.net/browse/SP-1)\n``` quote\nThis is a comment that likes to **exercise** a lot of _different_ `conventions` that `jira uses`.\r\n\r\n~~~\n\r\nthis code is not highlighted, but monospaced\r\n\n~~~\r\n\r\n~~~\n\r\ndef python():\r\n print "likes to be formatted"\r\n\n~~~\r\n\r\n[http://www.google.com](http://www.google.com) is a bare link, and [Google](http://www.google.com) is given a title.\r\n\r\nThanks!\r\n\r\n~~~ quote\n\r\nSomeone said somewhere\r\n\n~~~!\n**Niloth**\n@_**King Hamlet|10**\n```"""
|
||||
self.check_webhook("comment_created", expected_topic_name, expected_message)
|
||||
|
||||
def test_comment_created_no_issue_details(self) -> None:
|
||||
expected_topic_name = "10000: Upgrade Jira to get the issue title here."
|
||||
expected_message = """Hemanth V. Alluri commented on 10000: Upgrade Jira to get the issue title here.\n``` quote\nSounds like it’s pretty important. I’ll get this fixed ASAP!\n```"""
|
||||
self.check_webhook(
|
||||
"comment_created_no_issue_details", expected_topic_name, expected_message
|
||||
)
|
||||
|
||||
def test_comment_updated(self) -> None:
|
||||
expected_topic_name = "SP-1: Add support for newer format Jira issue comment events"
|
||||
expected_message = """Hemanth V. Alluri updated their comment on [SP-1: Add support for newer format Jira issue comment events](https://f20171170.atlassian.net/browse/SP-1)\n``` quote\nThis is a very important issue! I’m on it!\n```"""
|
||||
self.check_webhook("comment_updated", expected_topic_name, expected_message)
|
||||
|
||||
def test_comment_deleted(self) -> None:
|
||||
expected_topic_name = "SP-1: Add support for newer format Jira issue comment events"
|
||||
expected_message = """Hemanth V. Alluri deleted their comment on [SP-1: Add support for newer format Jira issue comment events](https://f20171170.atlassian.net/browse/SP-1)\n``` quote\n~~This is a very important issue! I’m on it!~~\n```"""
|
||||
self.check_webhook("comment_deleted", expected_topic_name, expected_message)
|
||||
|
||||
def test_anomalous_webhook_payload_error(self) -> None:
|
||||
with self.assertRaises(AssertionError) as e:
|
||||
self.check_webhook(
|
||||
fixture_name="example_anomalous_payload",
|
||||
expected_topic="",
|
||||
expected_message="",
|
||||
expect_noop=True,
|
||||
)
|
||||
|
||||
self.assertIn(
|
||||
"Unable to parse request: Did Jira generate this event?",
|
||||
e.exception.args[0],
|
||||
)
|
||||
|
||||
def test_created_silent_mention_by_email_fallback(self) -> None:
|
||||
othello = self.example_user("othello")
|
||||
expected_topic_name = "BUG-15: New bug with hook"
|
||||
expected_message = f"@_**{othello.full_name}|{othello.id}** created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) with major priority."
|
||||
self.check_webhook("issue_created", expected_topic_name, expected_message)
|
||||
|
||||
def test_comment_created_silent_mention_atlassian_account_id(self) -> None:
|
||||
realm = get_realm("zulip")
|
||||
atlassian_field = try_add_realm_default_custom_profile_field(realm, "atlassian")
|
||||
hamlet = self.example_user("hamlet")
|
||||
test_account_id = "5c76b994e1bcdf6294d0eb0f"
|
||||
self.set_user_custom_profile_data(
|
||||
hamlet, [{"id": atlassian_field.id, "value": test_account_id}]
|
||||
)
|
||||
|
||||
expected_topic_name = "SP-1: Add support for newer format Jira issue comment events"
|
||||
expected_message = f"""@_**{hamlet.full_name}|{hamlet.id}** commented on [SP-1: Add support for newer format Jira issue comment events](https://f20171170.atlassian.net/browse/SP-1)\n``` quote\nThis is a comment that likes to **exercise** a lot of _different_ `conventions` that `jira uses`.\r\n\r\n~~~\n\r\nthis code is not highlighted, but monospaced\r\n\n~~~\r\n\r\n~~~\n\r\ndef python():\r\n print "likes to be formatted"\r\n\n~~~\r\n\r\n[http://www.google.com](http://www.google.com) is a bare link, and [Google](http://www.google.com) is given a title.\r\n\r\nThanks!\r\n\r\n~~~ quote\n\r\nSomeone said somewhere\r\n\n~~~!\n**Niloth**\n@_**{hamlet.full_name}|{hamlet.id}**\n```"""
|
||||
self.check_webhook("comment_created", expected_topic_name, expected_message)
|
||||
373
zerver/webhooks/jira/view.py
Normal file
373
zerver/webhooks/jira/view.py
Normal file
@@ -0,0 +1,373 @@
|
||||
# Webhooks for external integrations.
|
||||
import re
|
||||
import string
|
||||
from collections.abc import Callable
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db.models import Q
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
|
||||
from zerver.decorator import webhook_view
|
||||
from zerver.lib.exceptions import AnomalousWebhookPayloadError, UnsupportedWebhookEventTypeError
|
||||
from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS
|
||||
from zerver.lib.mention import silent_mention_syntax_for_user
|
||||
from zerver.lib.response import json_success
|
||||
from zerver.lib.typed_endpoint import JsonBodyPayload, typed_endpoint
|
||||
from zerver.lib.validator import WildValue, check_none_or, check_string
|
||||
from zerver.lib.webhooks.common import (
|
||||
check_send_webhook_message,
|
||||
guess_zulip_user_from_external_account,
|
||||
)
|
||||
from zerver.models import Realm, UserProfile
|
||||
from zerver.models.users import get_user_by_delivery_email
|
||||
|
||||
IGNORED_EVENTS = [
|
||||
"attachment_created",
|
||||
"issuelink_created",
|
||||
"issuelink_deleted",
|
||||
"jira:version_released",
|
||||
"jira:worklog_updated",
|
||||
"sprint_closed",
|
||||
"sprint_started",
|
||||
"worklog_created",
|
||||
"worklog_updated",
|
||||
]
|
||||
|
||||
|
||||
def guess_zulip_user_from_jira(jira_username: str, realm: Realm) -> UserProfile | None:
|
||||
try:
|
||||
# Try to find a matching user in Zulip
|
||||
# We search a user's full name, short name,
|
||||
# and beginning of email address
|
||||
user = UserProfile.objects.filter(
|
||||
Q(full_name__iexact=jira_username) | Q(email__istartswith=jira_username),
|
||||
is_active=True,
|
||||
realm=realm,
|
||||
).order_by("id")[0]
|
||||
return user
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
|
||||
# https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
|
||||
def convert_jira_markup(content: str, realm: Realm) -> str:
|
||||
# Attempt to do some simplistic conversion of Jira
|
||||
# formatting to Markdown, for consumption in Zulip
|
||||
|
||||
# Jira uses *word* for bold, we use **word**
|
||||
content = re.sub(r"\*([^\*]+)\*", r"**\1**", content)
|
||||
|
||||
# Jira uses {{word}} for monospacing, we use `word`
|
||||
content = re.sub(r"{{([^\*]+?)}}", r"`\1`", content)
|
||||
|
||||
# Starting a line with bq. block quotes that line
|
||||
content = re.sub(r"bq\. (.*)", r"> \1", content)
|
||||
|
||||
# Wrapping a block of code in {quote}stuff{quote} also block-quotes it
|
||||
quote_re = re.compile(r"{quote}(.*?){quote}", re.DOTALL)
|
||||
content = re.sub(quote_re, r"~~~ quote\n\1\n~~~", content)
|
||||
|
||||
# {noformat}stuff{noformat} blocks are just code blocks with no
|
||||
# syntax highlighting
|
||||
noformat_re = re.compile(r"{noformat}(.*?){noformat}", re.DOTALL)
|
||||
content = re.sub(noformat_re, r"~~~\n\1\n~~~", content)
|
||||
|
||||
# Code blocks are delineated by {code[: lang]} {code}
|
||||
code_re = re.compile(r"{code[^\n]*}(.*?){code}", re.DOTALL)
|
||||
content = re.sub(code_re, r"~~~\n\1\n~~~", content)
|
||||
|
||||
# Links are of form: [https://www.google.com] or [Link Title|https://www.google.com]
|
||||
# In order to support both forms, we don't match a | in bare links
|
||||
content = re.sub(r"\[([^\|~]+?)\]", r"[\1](\1)", content)
|
||||
|
||||
# Full links which have a | are converted into a better Markdown link
|
||||
full_link_re = re.compile(r"\[(?:(?P<title>[^|~]+)\|)(?P<url>[^\]]*)\]")
|
||||
content = re.sub(full_link_re, r"[\g<title>](\g<url>)", content)
|
||||
|
||||
# Try to convert a Jira user mention of format [~username] into a
|
||||
# Zulip user mention. We don't know the email, just the Jira username,
|
||||
# so we naively guess at their Zulip account using this
|
||||
mention_re = re.compile(r"\[~(.*?)\]")
|
||||
for username in mention_re.findall(content):
|
||||
# Try to look up username
|
||||
user_profile = guess_zulip_user_from_jira(username, realm)
|
||||
if user_profile:
|
||||
replacement = silent_mention_syntax_for_user(user_profile)
|
||||
else:
|
||||
replacement = f"**{username}**"
|
||||
|
||||
content = content.replace(f"[~{username}]", replacement)
|
||||
|
||||
return content
|
||||
|
||||
|
||||
def get_in(payload: WildValue, keys: list[str], default: str = "") -> WildValue:
|
||||
try:
|
||||
for key in keys:
|
||||
payload = payload[key]
|
||||
except (AttributeError, KeyError, TypeError, ValidationError):
|
||||
return WildValue("default", default)
|
||||
return payload
|
||||
|
||||
|
||||
def get_issue_string(
|
||||
payload: WildValue, issue_id: str | None = None, with_title: bool = False
|
||||
) -> str:
|
||||
# Guess the URL as it is not specified in the payload
|
||||
# We assume that there is a /browse/BUG-### page
|
||||
# from the REST URL of the issue itself
|
||||
if issue_id is None:
|
||||
issue_id = get_issue_id(payload)
|
||||
|
||||
if with_title:
|
||||
text = f"{issue_id}: {get_issue_title(payload)}"
|
||||
else:
|
||||
text = issue_id # nocoverage
|
||||
|
||||
base_url = re.match(
|
||||
r"(.*)\/rest\/api/.*", get_in(payload, ["issue", "self"]).tame(check_string)
|
||||
)
|
||||
if base_url and len(base_url.groups()):
|
||||
return f"[{text}]({base_url.group(1)}/browse/{issue_id})"
|
||||
else:
|
||||
return text
|
||||
|
||||
|
||||
def get_user_mention(realm: Realm, user_payload: WildValue) -> str:
|
||||
"""Return a silent mention for a matched Zulip user, or the display name."""
|
||||
|
||||
# Account IDs are specific to Atlassian Cloud products.
|
||||
# Jira Data Center do not include accountId in their webhook payloads
|
||||
if "accountId" in user_payload:
|
||||
account_id = user_payload["accountId"].tame(check_string)
|
||||
external_account_field_name = str(DEFAULT_EXTERNAL_ACCOUNTS["atlassian"].name)
|
||||
zulip_user = guess_zulip_user_from_external_account(
|
||||
realm,
|
||||
account_id,
|
||||
external_account_field_name,
|
||||
external_username_case_insensitive=True,
|
||||
)
|
||||
if zulip_user is not None:
|
||||
return silent_mention_syntax_for_user(zulip_user)
|
||||
|
||||
# The presence of emailAddress in the payload depends on Jira's User email
|
||||
# visibility settings.
|
||||
if "emailAddress" in user_payload:
|
||||
email = user_payload["emailAddress"].tame(check_string)
|
||||
try:
|
||||
zulip_user = get_user_by_delivery_email(email, realm)
|
||||
return silent_mention_syntax_for_user(zulip_user)
|
||||
except UserProfile.DoesNotExist:
|
||||
pass
|
||||
|
||||
return user_payload["displayName"].tame(check_string)
|
||||
|
||||
|
||||
def get_issue_author(payload: WildValue, realm: Realm) -> str:
|
||||
user_payload = payload.get("user")
|
||||
return get_user_mention(realm, user_payload)
|
||||
|
||||
|
||||
def get_issue_id(payload: WildValue) -> str:
|
||||
if "issue" not in payload:
|
||||
# Some ancient version of Jira or one of its extensions posts
|
||||
# comment_created events without an "issue" element. For
|
||||
# these, the best we can do is extract the Jira-internal
|
||||
# issue number and use that in the topic.
|
||||
#
|
||||
# Users who want better formatting can upgrade Jira.
|
||||
return payload["comment"]["self"].tame(check_string).split("/")[-3]
|
||||
|
||||
return get_in(payload, ["issue", "key"]).tame(check_string)
|
||||
|
||||
|
||||
def get_issue_title(payload: WildValue) -> str:
|
||||
if "issue" not in payload:
|
||||
# Some ancient version of Jira or one of its extensions posts
|
||||
# comment_created events without an "issue" element. For
|
||||
# these, the best we can do is extract the Jira-internal
|
||||
# issue number and use that in the topic.
|
||||
#
|
||||
# Users who want better formatting can upgrade Jira.
|
||||
return "Upgrade Jira to get the issue title here."
|
||||
|
||||
return get_in(payload, ["issue", "fields", "summary"]).tame(check_string)
|
||||
|
||||
|
||||
def get_issue_topic(payload: WildValue) -> str:
|
||||
return f"{get_issue_id(payload)}: {get_issue_title(payload)}"
|
||||
|
||||
|
||||
def add_change_info(
|
||||
content: str, field: str | None, from_field: str | None, to_field: str | None
|
||||
) -> str:
|
||||
content += f"* Changed {field}"
|
||||
if from_field:
|
||||
content += f" from **{from_field}**"
|
||||
if to_field:
|
||||
content += f" to {to_field}\n"
|
||||
return content
|
||||
|
||||
|
||||
def handle_updated_issue_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
# Reassigned, commented, reopened, and resolved events are all bundled
|
||||
# into this one 'updated' event type, so we try to extract the meaningful
|
||||
# event that happened
|
||||
issue_id = get_in(payload, ["issue", "key"]).tame(check_string)
|
||||
issue = get_issue_string(payload, issue_id, True)
|
||||
|
||||
assignee = get_in(payload, ["issue", "fields", "assignee"])
|
||||
|
||||
if assignee.value and isinstance(assignee.value, dict):
|
||||
assignee_mention = get_user_mention(user_profile.realm, assignee)
|
||||
else:
|
||||
assignee_mention = ""
|
||||
|
||||
if assignee_mention != "":
|
||||
assignee_blurb = f" (assigned to {assignee_mention})"
|
||||
else:
|
||||
assignee_blurb = ""
|
||||
|
||||
content = (
|
||||
f"{get_issue_author(payload, user_profile.realm)} updated {issue}{assignee_blurb}:\n\n"
|
||||
)
|
||||
changelog = payload.get("changelog")
|
||||
|
||||
if changelog:
|
||||
# Use the changelog to display the changes, whitelist types we accept
|
||||
items = changelog.get("items")
|
||||
for item in items:
|
||||
field = item.get("field").tame(check_none_or(check_string))
|
||||
|
||||
if field == "assignee" and assignee_mention != "":
|
||||
target_field_string = assignee_mention
|
||||
else:
|
||||
# Convert a user's target to a @-mention if possible
|
||||
target_field_string = "**{}**".format(
|
||||
item.get("toString").tame(check_none_or(check_string))
|
||||
)
|
||||
|
||||
from_field_string = item.get("fromString").tame(check_none_or(check_string))
|
||||
if target_field_string or from_field_string:
|
||||
content = add_change_info(content, field, from_field_string, target_field_string)
|
||||
|
||||
return content
|
||||
|
||||
|
||||
def handle_created_issue_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
priority = get_in(payload, ["issue", "fields", "priority", "name"]).tame(check_string).lower()
|
||||
|
||||
assignee_payload = get_in(payload, ["issue", "fields", "assignee"])
|
||||
if assignee_payload.value and isinstance(assignee_payload.value, dict):
|
||||
assignee_blurb = f" (assigned to {get_user_mention(user_profile.realm, assignee_payload)})"
|
||||
else:
|
||||
assignee_blurb = ""
|
||||
|
||||
template = "{author} created {issue_string} with {priority} priority{assignee_blurb}."
|
||||
return template.format(
|
||||
author=get_issue_author(payload, user_profile.realm),
|
||||
issue_string=get_issue_string(payload, with_title=True),
|
||||
priority=priority,
|
||||
assignee_blurb=assignee_blurb,
|
||||
)
|
||||
|
||||
|
||||
def handle_deleted_issue_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
template = "{author} deleted {issue_string}{punctuation}"
|
||||
title = get_issue_title(payload)
|
||||
punctuation = "." if title[-1] not in string.punctuation else ""
|
||||
return template.format(
|
||||
author=get_issue_author(payload, user_profile.realm),
|
||||
issue_string=get_issue_string(payload, with_title=True),
|
||||
punctuation=punctuation,
|
||||
)
|
||||
|
||||
|
||||
def normalize_comment(comment: str, realm: Realm) -> str:
|
||||
comment = convert_jira_markup(comment, realm)
|
||||
|
||||
# Here's how Jira escapes special characters in their payload:
|
||||
# ,.?\\!\n\"'\n\\[]\\{}()\n@#$%^&*\n~`|/\\\\
|
||||
# for some reason, as of writing this, ! has two '\' before it.
|
||||
normalized_comment = comment.replace("\\!", "!")
|
||||
return normalized_comment
|
||||
|
||||
|
||||
def get_comment_author(comment_payload: WildValue, realm: Realm) -> str:
|
||||
author_payload = comment_payload.get("author")
|
||||
return get_user_mention(realm, author_payload)
|
||||
|
||||
|
||||
def handle_comment_created_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
return "{author} commented on {issue_string}\
|
||||
\n``` quote\n{comment}\n```\n".format(
|
||||
author=get_comment_author(payload["comment"], user_profile.realm),
|
||||
issue_string=get_issue_string(payload, with_title=True),
|
||||
comment=normalize_comment(
|
||||
payload["comment"]["body"].tame(check_string), user_profile.realm
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def handle_comment_updated_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
return "{author} updated their comment on {issue_string}\
|
||||
\n``` quote\n{comment}\n```\n".format(
|
||||
author=get_comment_author(payload["comment"], user_profile.realm),
|
||||
issue_string=get_issue_string(payload, with_title=True),
|
||||
comment=normalize_comment(
|
||||
payload["comment"]["body"].tame(check_string), user_profile.realm
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def handle_comment_deleted_event(payload: WildValue, user_profile: UserProfile) -> str:
|
||||
return "{author} deleted their comment on {issue_string}\
|
||||
\n``` quote\n~~{comment}~~\n```\n".format(
|
||||
author=get_comment_author(payload["comment"], user_profile.realm),
|
||||
issue_string=get_issue_string(payload, with_title=True),
|
||||
comment=normalize_comment(
|
||||
payload["comment"]["body"].tame(check_string), user_profile.realm
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
JIRA_CONTENT_FUNCTION_MAPPER: dict[str, Callable[[WildValue, UserProfile], str] | None] = {
|
||||
"jira:issue_created": handle_created_issue_event,
|
||||
"jira:issue_deleted": handle_deleted_issue_event,
|
||||
"jira:issue_updated": handle_updated_issue_event,
|
||||
"comment_created": handle_comment_created_event,
|
||||
"comment_updated": handle_comment_updated_event,
|
||||
"comment_deleted": handle_comment_deleted_event,
|
||||
}
|
||||
|
||||
ALL_EVENT_TYPES = list(JIRA_CONTENT_FUNCTION_MAPPER.keys())
|
||||
|
||||
|
||||
@webhook_view("Jira", all_event_types=ALL_EVENT_TYPES)
|
||||
@typed_endpoint
|
||||
def api_jira_webhook(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
*,
|
||||
payload: JsonBodyPayload[WildValue],
|
||||
) -> HttpResponse:
|
||||
event = payload.get("webhookEvent").tame(check_none_or(check_string))
|
||||
if event in IGNORED_EVENTS:
|
||||
return json_success(request)
|
||||
|
||||
if event is None:
|
||||
raise AnomalousWebhookPayloadError
|
||||
|
||||
if event is not None:
|
||||
content_func = JIRA_CONTENT_FUNCTION_MAPPER.get(event)
|
||||
|
||||
if content_func is None:
|
||||
raise UnsupportedWebhookEventTypeError(event)
|
||||
|
||||
topic_name = get_issue_topic(payload)
|
||||
content: str = content_func(payload, user_profile)
|
||||
|
||||
check_send_webhook_message(
|
||||
request, user_profile, topic_name, content, event, unquote_url_parameters=True
|
||||
)
|
||||
return json_success(request)
|
||||
Reference in New Issue
Block a user