Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create Webhook url link using a custom field from the issue?

jaime
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 13, 2019

I'm creating a webhook and I'd like to use custom fields in the query params,
for example: 
https://example.com/api/new?id=${issue.id}&c1=${issue.custom_field1}&c2=${issue.custom_field2}
but I don't know how to reference them using ${issue.field} syntax.

Note: My custom field names have multiple words.

Thanks in advance

2 answers

1 vote
Atif Hafeez
Contributor
August 31, 2020

I believe webhooks are there to notify you events(they behave as triggers). now if you want to get additional information about custom fields or update it, then you need to use the rest apis exposed by the application. These rest apis will meet all your requirements

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2019

Hi Jamie,

I am afraid that the webhooks you can create in Jira have a limited number of fields that can be passed as substitution variables in the URL itself.  These are documented over in https://developer.atlassian.com/server/jira/platform/webhooks/ in the section called 'Variable substitution in the webhook URL'

The variables are the following:

  • ${board.id} 
  • ${issue.id} 
  • ${issue.key} 
  • ${mergedVersion.id} 
  • ${modifiedUser.key} 
  • ${modifiedUser.name} 
  • ${project.id} 
  • ${project.key} 
  • ${sprint.id} 
  • ${version.id}

Unfortunately, there is not a clear option to use any other field value aside from these variables here.   There is however a feature request to extend this to also allow for custom fields over in

Should Jira ever get this particular feature, I would expect that ticket to be updated to reflect this and indicate which version might gain that in an updated release.  I also searched through our Marketplace site for alternatives to this, but I found no other solutions here as of today.

Andy

Suggest an answer

Log in or Sign up to answer