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

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

This widget could not be displayed.

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

220 views 3 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you