connecting jira workflow transitions to an external database event

Sonal Singh June 16, 2020

I need to trigger a certain even in an external database when a workflow status transitions from A to B. I have successfully used the post function which triggers a webhook on status transition but i am still stuck with triggering a database function. since webhooks accept 'https' in the url so no database address can be specified there. How to connect the workflow transition to the databse (which i connected using scriptrunner resources) . i am not on jira cloud

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2020

You can use SR to connect to a database and issue SQL in it.  The main recipe I have bookmarked for that is https://scriptrunner.adaptavist.com/5.4.28/jira/recipes/misc/connecting-to-databases.html

Sonal Singh June 16, 2020

Thanks Nic, I had gone through the above adaptavist resource but my main concern still remains how to connect workflow transitions to the database? I can query the database using sqls but how will the database know when an issue is say updated?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2020

You can put the code that connects to the database into post functions (if you want to issue the SQL on issue changing status), or listeners if it's for any form of update.

Sonal Singh June 16, 2020

I am sorry but I think I didn't understand you. The database connection will be achieved by SR resources. What am I supposed to write in the post functions? Also I saw only predefined post functions, does jira allow custom postf too? Apologies for too many questions, I am new to JIRA .

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events