Atlassian connect add-on can't use context parameters in descriptor file

Han Nguyen June 26, 2015

Hi everyone, i got two issues with the descriptor file in my connect add-on.

(1) About webhook:

I want update our database when user changed an issue status, so i use webhook "jira:issue_updated" to do this as the code below in descriptor file:

 

....
"webhooks": [
{
"event": "jira:issue_updated",
"url": "/issue-updated"
}
....

 

However i just got the request with "user_key", what i need is at least i can get the "issue_key", then i can use REST API to query the last status of issue. If i can get immediately what's changed about issue is so great.

 

I also tried with this:

 

....
"webhooks": [
{
"event": "jira:issue_updated",
"url": "/issue-updated/?issue_key={issue.key}"
}
....

 

and

 

....
"webhooks": [
{
"event": "jira:issue_updated",
"url": "/issue-updated/?issue_key=${issue.key}"
}
....

 

 

However, i can't install the add-on with the url contain the context parameter, it says: "An error occurred while installing the add-on. Refer to the logs for more information."

(I follow this instruction: https://developer.atlassian.com/static/connect/docs/latest/modules/common/webhook.html  to do the webhook)

 

(2) About the Lifecycle callback to our server whenever user installed the add-on:

The callback works fine, however i also only received the parameter "user_key", and no anything more. How can i receive other parameters like this?

{
"key": "installed-addon-key",
"clientKey": "unique-client-identifier",
"publicKey": "MIGf....ZRWzwIDAQAB",
"sharedSecret": "a-secret-key-not-to-be-lost",
"serverVersion": "server-version",
"pluginsVersion": "version-of-connect",
"baseUrl": "http://example.atlassian.net",
"productType": "jira",
"description": "Atlassian JIRA at https://example.atlassian.net",
"serviceEntitlementNumber": "SEN-number",
"eventType": "installed"
}

(I follow this instruction: https://developer.atlassian.com/static/connect/docs/latest/modules/lifecycle.html to do the the callback of lifecycle)

 

Thanks so much for viewing my issues.

 

2 answers

1 vote
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2015

Hi Han, I think you have the same issue with both requests. You are expecting the results to come back in the URL query parameters but both of those resources (the webhooks resource and the lifecycle resources) are actually POSTing data back to you that contains the information that you are looking for.

I highly recommend that you log the data that is coming back in the body of the response because then you will see it all in JSON format ready for your consumption.

If you want a tool that can do this for you with respect to webhooks then I highly recommend using the webhook-inspector: https://bitbucket.org/atlassianlabs/webhook-inspector

0 votes
Han Nguyen June 29, 2015

Hi Robert, thank you so much for your help.

Both requests are worked fine now and i got what i'm expecting, once again, thank you! smile

Suggest an answer

Log in or Sign up to answer