I have created an addon with a configuration page in which the user has to store a clienId and clientSecret. This credentials are sent to Jira Cloud using the REST API:
PUT /rest/atlassian-connect/1/addons/$addonKey/properties/apiCredentials
Besides the application uses the webhook module and I need that whenever an issue is created/updated the webhook sends the clientId/clientSecret params stored previously as app config parameters.
How can it be done?
My atlassian-connect.json:
{
"key": "${addon.key}",
"baseUrl": "xxx/",
"name": "xxx",
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed",
"uninstalled": "/uninstalled"
},
"scopes": ["READ","WRITE"],
"modules": {
"webhooks": [
{
"event": "jira:issue_created",
"url": "/issues/created?project={project.key}&issue={issue.key}"
},
{
"event": "jira:issue_updated",
"url": "/issues/updated?project={project.key}&issue={issue.key}"
}
],
"adminPages": [
{
"url": "/admin",
"name": {
"value": "My Admin Page"
},
"key": "my-admin-page"
}
],
"configurePage": {
"url": "/config",
"name": {
"value": "xxx"
},
"key": "my-config-page"
}
}
}