Creating an Issue and using custom form to call external API

Taylor Bianchi March 31, 2021

I am looking to create a custom form that teams would fill out that would be used by Jira (ideally) to call an external API and consumed by that application.

 

Is there a way to do this beyond conceptually? I've been searching and I think I have a couple of the pieces but I'm not sure if this is actually feasible.

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2021

Hi @Taylor Bianchi , welcome on the community.

Can you describe your use case in more detail? I will try to rewrite it but I do not think I'm correct

  1. you want to create form in different system/web page
  2. you want to connect this form to Jira, so users can create Jira issues using YOUR form

Is that correct?

Taylor Bianchi March 31, 2021

Hey @Martin Bayer _MoroSystems_ s_r_o__ thanks for that.

 

Let me clarify:

1. Create a form in Jira that collects the pertinet parameters I want to pass to the external API

2. Take the user inputs from this form and generate an API call to the external system to execute action(s).

 

My initial thought was a Service Desk form that creates an issue but not sure the use case is aligned enough to that.

 

I was reading this: https://community.atlassian.com/t5/Jira-questions/Call-external-REST-API-from-workflow-transition/qaq-p/793424

and this: https://community.atlassian.com/t5/Adaptavist-questions/Making-a-REST-call-using-script-runner/qaq-p/576712

and while these seem kind of aligned they aren't exactly what I had in mind and may be over-engineering what I "think" is a little more simplistic.

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2021

Yeah I think you are on it already. You must

  1. specify Custom Fields which will collect required information
  2. set these custom fields to be present on Jira Service Management form
  3. adjust workflow's initial step (step which creates the issue)
  4. add ScriptRunner postfunction (there are maybe more apps but I know the scriptrunner) to it
    1. it contains REST API call
    2. it is implemented in Groovy

Or there is maybe "Free" solution but I never tested it. You can obviously Send web request using Automation. It looks like:

Selection_200.png

It will contain all the Issue data. So it would be necessary to adjust your external API to accept JSON representing issue as webhook's body.

Taylor Bianchi March 31, 2021

Thanks very much @Martin Bayer _MoroSystems_ s_r_o__ this is really helpful. A couple questions for clarity...

1. Does the webhook allow for customized parameters to be passed to the external API? I was reading through the documentation and it seemed to suggest that the external API should be modified to consume what Jira has available as it cannot be modified. Ergo, this idea of bringing in Custom Fields wouldn't be possible.

2. Is the workflow generated automatically from which I can modify the step as you delineate above? Or is this something I have to bring in on my own?

3. Finally, can what you describe here be extrapolated to a non-Cloud/SaaS Jira implementation... i.e. hosted in an enterprise environment but with external connectivity?

Martin Bayer _MoroSystems_ s_r_o__
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 1, 2021

@Taylor Bianchi 

No webhook can't be customized and I was thinking about it little bit...webhok only invokes some web service endpoint, but you cannot use the response to set custom field values. So the only option is to use script runner postfunction (or other App).

Workflow is set on combination of project and issuetype (it is called Workflow scheme). One workflow scheme can be used for multiple projects. You can get more information here: https://support.atlassian.com/jira-cloud-administration/docs/manage-issue-workflows/

You can implement similar functionality on Server too. But you will also need a scriptrunner. The only difference is that you can use Jira Java API on Server (only Jira REST API can be used on Cloud)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events