Hello! I wonder how I can integrate Jenkins and Jita ( Deployment info). I successfully did everything from this tutorial: https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-jenkins/But I can't find the following parameters: environmentId, environmentName, and environmentType. Where I can find them?Thanks in advance!
Hi @Nikita Sevostyanov
While I'm not an expert in this particular integration, I believe I found the answer here. Check out the Readme.md in https://github.com/jenkinsci/atlassian-jira-software-cloud-plugin it indicates that
we use a post step to send deployment data to Jira and the relevant issues. Here, the environmentId, environmentName, and environmentType need to be set to whatever you want to appear in Jira.
So those values are not expected to be found in Jira, but rather these are something that you supply about the Jenkins environment that you want to appear within Jira.
I found some more info on these fields over in https://www.jenkins.io/doc/pipeline/steps/atlassian-jira-software-cloud/ which indicates these are optional fields to begin with.
I hope this helps.
Andy
Hi @Nikita Sevostyanov @Andy Heinzer I have done the implementation using below apis to send deployment info on jira using post request. But facing issues while assigning env variable for environmentId parameter in post request. Getting this error.
"acceptedDeployments": [ ], "rejectedDeployments": [ { "key": { "deploymentSequenceNumber": 35 }, "errors": [ { "message": "Invalid JSON: \u0027environment\u0027 is invalid. Must be of type EnvironmentDetails." } ] } ]
https://developer.atlassian.com/cloud/jira/software/rest/api-group-deployments/#api-rest-deployments-0-1-bulk-postThanks in advance, any help on this would be appreciable.
@Pranav Lonsane @Nikita Sevostyanov
The API simply needs an environment that you can specific within your request to the API.
I left out the other bits but your request needs to include the following:
{ "deployments": [ { ... "environment": { "id": "unique-env-id", "displayName": "env-name", "type": "env-type" }, ... } ]}
Simple replace `unique-env-id` with a unique Id of the environment. In my app I use this line to generate an Id based on the name of the environment
UUID.nameUUIDFromBytes(environmentName.getBytes(StandardCharsets.UTF_8)).toString()
Replace `env-name` with a human readable name of the environment.
And finally replace `env-type` with one of the following possible values unmapped, development, testing, staging, production
unmapped
development
testing
staging
production
Thanks for your inputs @Mark Rekveld - Marvelution But I am using powershell script below and unfamilier with
this.can you please explain in detail how and where should I run above line so I can get environment parameters in that format.Here is my powershell script.
Hi @Pranav Lonsane
Sorry, that line is for Java.
The objective of the line to generate an id based on the input. If the input is gives twice without changing it then the generated id should be the same.
You can also use a checksum like MD5.
But if you already have an unique id that is available in the context of the build, then you can use that as well.
I have never worked with powershell so am not sure if it has the capability to generate a unique string based on another string.
If all else fails, you can always opt to manually specify an id. Especially if the environment is only used with one build, then why generate if you can specify.
Cheers,Mark
It looks like you're new here. Sign in or register to get started.