I'm looking for advice on the best way to retrieve Fix Version from a ticket in ProjY and then copy it over to a new ticket in ProjX. Initial thought is to use webhook/api to query and store as a variable. But curious your thoughts and guidance.
Additional context: I'm have users input data into Proforma and that is kicking off several pieces of automation.
This was the result. It's not finding the lookup.
To troubleshoot, in the JQL I tried hardcoding the value: key=UE-205953 and then clicked Validate. It returned 0 Issues found.
I know that specific issues really does exist. So I then did a search using: key=UE-205953 (https://mydomain.com/browse/UE-205953?jql=key%3DUE-205953) and doing it that way does show the ticket.
As you stated, "Automation rules functionality provided by Atlassian are scoped to Project."
That leads me to believe that i can not do a lookupIssues of a ticket outside the scope of my project that is executing the automation. If I got god-level permissions for my project is it possible to increase the Scope?
You can achieve this yourself by making REST call to get this data.
Have you ever tried doing a "send web request" action from Jira automation. If not, do you know how to get yourself Access token?
Also, Can you please post your above message to my other post so that all discussion is together for others to reference in the future.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry about the thread issue. I thought I hit reply and apparently did not. (hope I'm doing it right now)
I already have an access token that I've been using to make curl calls to https://mydomain.com/rest/api/2/search?jql=issueKey=UE-205953&fields=fixVersions
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer PCtIEmopbvIe17HDrT3agvDNYNaMHaVfBg642l" "https://mydomain.com/rest/api/2/search?jql=issueKey=UE-205953&fields=fixVersions"
{"expand":"names,schema","startAt":0,"maxResults":50,"total":1,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"3154001","self":"https://mydomain.com/rest/api/2/issue/3154001","key":"UE-205953","fields":{"fixVersions":[{"self":"https://mydomain.com/rest/api/2/version/45915","id":"45915","description":"Major Release","name":"5.4","archived":false,"released":false}]}}]}%
I've never used the Jira Send Web Request before. I assume it should be something like:
I clicked the Validate link and I got an HTTP Response 200 and the Payload was:
{ "expand": "names,schema", "startAt": 0, "maxResults": 50, "total": 1, "issues": [ { "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields", "id": "3154001", "self": "https://mydomain.com/rest/api/2/issue/3154001", "key": "UE-205953", "fields": { "fixVersions": [ { "self": "https://mydomain.com/rest/api/2/version/45915", "id": "45915", "description": "Major Release", "name": "5.4", "archived": false, "released": false } ] } } ] }
I see the data I want to copy "5.4" under issues.fields.fixVersions.name but don't know how to extract that using the Jira Send Web Request component
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome. After this step, you can log below value to extract the fix Version. (see further below)
{{webhookresponse.body.fields.fixVersions.name}}
Now Do you know if the "bug" issue can have more than 1 fix version to it? If so, what do you want to do. Assign all of them or choose one of them?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I put the log component in but doesnt seem to retrieve the data.
Here is the entire automation:
Any thoughts on the issue? This part is completely new to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, did not see the end point you used. Please log below value:
{{webhookresponse.body.issues.fields.fixVersions.name}}
As I said, if you think you *may* have multiple, you could log below to pick last one for example.
{{webhookresponse.body.issues.fields.fixVersions.name.last}}
Next we need to solve how to check if this version already exists issue in Proj X.
Do you know if this version should already exist or do you not know?
Cause since you are in Data center edition, you dont have Advanced Branch option ( like me), so we have to think through that one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately neither
{{webhookresponse.body.issues.fields.fixVersions.name}} nor
{{webhookresponse.body.issues.fields.fixVersions.name.last}} return anything in the Audit Log.
Any thoughts on what I might be doing wrong here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please make sure that in your send web request step, you have the "Delay execution" check box selected. (see screenshot below)
Also, your current end point is good and it works the same, but you can directly call the issue using below end point. Its just easy to work with. So instead of:
https://yourdomain.net/rest/api/2/search?jql=key=UE-205953&fields=fixVersions
Use below end point:
https://yourdomain.net/rest/api/2/issue/UE-205953
And right after the call, log below smart value:
{{webhookresponse.body.fields.fixVersions.name.first}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BINGO! "5.4" "Delay execution" did the trick. I updated the end point and confirmed that worked as well.
I also added the Proforma Ticket ID into a variable and then added that variable to my end point. Tested it and it works. So now I have dynamic input that makes the right end point calls.
@Kalyan Sattaluri i truly appreciate your help and patience and time! Thank YOU! YOU freaking rock!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome.
I think next you need to do an if check to determine if your bug's fix version exists in your Epic's project cause if it does not exist, you need to create it, else you can directly add.
For this, the fix version you got above, save it in a new variable, lets call it (myvar).
Then, you make a call to get all versions in project "UE" using below end point and check if it has the version you pulled.
To get the versions, you need the end point:
https://yourdomain.net/rest/api/2/project/UE/versions
Below is how your calls will look like,
First you get the fix version in first call, store that in a variable, next you make a call to get versions, then compare to the variable to see if version already exists.
I stopped at if check, if condition passes you can update.
If condition does not pass, you need to create the version first before your edit.
Sharing some high level steps, let me know if questions.
Also, if you think you are good, please consider to mark my answer accepted so others can find this discussion helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Lee Graham
Welcome to the community. Automation rules functionality provided by Atlassian are scoped to Project.
In other words, if in ProjX's automation section, you are able to write a JQL which gives you issues of ProjY, then you can do this with native functionality. Maybe we can discuss your trigger and how to achieve this after.
OTOH, when in ProjX's automation section, your JQL is not able to retrieve issue in ProjY, then you are limited to use "Send web request" action/ Rest API route to gather this fix version.
Finally, irrespective of the route you take, this Fix Version you want (to copy over from issue in Y to issue in X) should already exist in X.
If it may / may not exist, you have to also create this fix version before you assign to the issue, which will require you to make a REST calls to get a list of existing versions and make a PUT call to create one if needed.
Please let us know of any questions/clarifications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you!
Additional context: It is complicated [and perhaps there is a better way :)] as ProjX is a centralized Jira "project/program" that will support all the other various Jira projects. As it supports all the other Jira Projects (fixVersions will be all over the place (examples: ProjectA fixVersion = 5.3, 5.4, ... OR ProjectN fixVersion = v.28.10, v29.50, ...)
Here is the current triggering of events from Proforma expanded on.
Again, I may be doing this completely backward and 100% to all advice and guidance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After step 2, can you do below steps shown in below screenshot and share your audit log. This will tell if you have scope or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.