CircleCI-Public / jira-orb

Connect your CircleCI pipelines to Jira.
https://circleci.com/docs/jira-plugin/
MIT License
3 stars 15 forks source link

[Question] What value should I provide to `environment`? #17

Closed ericgrubaughcompass closed 12 months ago

ericgrubaughcompass commented 1 year ago

I don't understand what the environment string should be.

Using this code:

      - jira/notify:
          pipeline_id: << pipeline.id >>
          pipeline_number: << pipeline.number >>
          environment: 'sb1'
          environment_type: 'development'
          job_type: deployment

The resulting Deployment looks like:

image

I was expecting the display name of the Environment to be 'sb1', but looking at the Orb source, it places my environment value in the id property of an environment. What ID is expected here? Where are these Environments/IDs defined?

tmannherz commented 1 year ago

This seems like another backwards-compatibility break vs v1.3.1 because with 1.3.1 you could get consist environment names in Jira using environment. Now with 2.0+ Jira is clouded with a bunch of UUIDs so you can't actually tell anymore what environment was deployed to.

image

The "Environment name" column used to be populated with Production or Development since that's what we have set in the environment field. Doesn't look like that is respected anymore.

kardashov commented 1 year ago

I have the same problem. What is displayed in Jira's UI is environment.displayName field. It is populated by orb like this "displayName": "${CIRCLE_JOB}::${JIRA_VAL_PIPELINE_ID}" here deployment_payload.json.

According to example in Jira API reference environment.displayName should have human readable form, not identifiers: image

I think it will be better to populate BOTH environment.id and environment.displayName fields with user provided environment parameter. Or just switch definitions of id and displayName in deployment_payload.json

mattrabe commented 1 year ago

I've used @kardashov's observations to create the PR above

mattrabe commented 1 year ago

While we await a fix merged into this orb, I've published a fork of v2.0.1 of this orb, but with my PR change applied and v2.0.2 assigned: https://circleci.com/developer/orbs/orb/fpcs/jira?version=2.0.2