notifications-engine icon indicating copy to clipboard operation
notifications-engine copied to clipboard

Support for Atlassian's Jira

Open alexmt opened this issue 3 years ago • 10 comments

By @AlexDHoffer: https://github.com/argoproj-labs/argocd-notifications/issues/240

Some existing CD systems e.g. Jenkins can post build results to Jira issues as well as natively link commits in the build to those issues. See here for details: https://plugins.jenkins.io/jira/

This is a slick feature for a CD system and since Atlassian's Jira is in such widespread usage these days it would be cool to have something similar, where ArgoCD can key off a Jira issue tag in a commit message and post when a successful sync of that tag occurred back to the issue itself in Jira.

alexmt avatar May 16 '21 00:05 alexmt

Has anybody worked around this? Thinking about a PostSync hook but this would require a dedicated pod to connect with the Jira API and a solution to get the git diff of the sync inside this pod. Or probably easier to listen for ArgoCD webhooks and do the work.

onmomo avatar Dec 15 '21 15:12 onmomo

Hello Is there a status on this for bringing this in? Either that or possibly suggestions on how it could be incorporated?

JeffreyGarrett avatar Mar 25 '22 16:03 JeffreyGarrett

Hi , any updates here?

Aditya-velotio avatar May 16 '22 16:05 Aditya-velotio

Bump

nweiler avatar Sep 23 '22 20:09 nweiler

Where would ArgoCD get the deployment information from? I'm looking at the deployment API and you need to pass an issue key to annotate the Jira issue with the deployment information.

It's not clear where this would come from. Potentially it could be build into the container as a label I guess?

mjallday avatar Feb 16 '23 00:02 mjallday

Where would ArgoCD get the deployment information from? I'm looking at the deployment API and you need to pass an issue key to annotate the Jira issue with the deployment information.

It's not clear where this would come from. Potentially it could be build into the container as a label I guess?

We have that information attached to commits in the Git repo used to build the docker image Argo uses. But that repo is of course not connected to Argo in any way. If this is a common setup one idea would be to link a repo to read issue keys from commit messages

johan-lejdung avatar Mar 27 '23 11:03 johan-lejdung

Did someone tried with that? : https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-rest-deployments-0-1-bulk-post

The jira/gha integration works by looking for issue keys in each commits deployed. I guess most of the time the deployment trigger comes from a PR, then we can fill the issue key array with all issue id found.

trash-anger avatar May 02 '23 17:05 trash-anger

In case it helps others, I found this example in slack (I haven't tested if it works):

  trigger.on-sync-succeeded: |
    - description: Application syncing has succeeded
      send:
      - atlassian
      when: app.status.operationState.phase in ['Succeeded']
  template.atlassian: |
    webhook:
      atlassian:
        method: POST
        body: |
           {"fields": {"project":{"key": "OP"},"summary": "please ignore {{.app.metadata.name}}","description": "argocd notification check this out {{.context.argocdUrl}}/applications/{{.app.metadata.name}} is in status {{.app.status.sync.status}}","issuetype": {"name": "Bug"},"components": [{"name" : "OES"}],"priority": { "name": "Low"}}}
  service.webhook.atlassian: |
    url: https://devops.atlassian.net/rest/api/2/issue/
    basicAuth:
      username: $jira-username
      password: $jira-password
    headers:
    - name: Content-Type
      value: application/json

jessesuen avatar Jul 17 '23 17:07 jessesuen