How to edit version.description after a version is created?

Sere Walkens July 10, 2023

I want to add more information to version.description after a version is created. To be specific, after detecting the version is created, I want to send a get request, get a reponse, then concat the response to version.description. Am I able to do this? I tried the concat function in "Add value to the audit log" action but it does not work out. Thank you!

2 answers

0 votes
Sere Walkens July 11, 2023

Still waiting for answer

0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2023

Hi @Sere Walkens 

could you please send a screenshot of the current state of your automation rule?

This might help to get a better understanding of your requirement and to see where you might got stuck.

Best
Stefan

Sere Walkens July 11, 2023

The trigger of my automation is when version created. First, I get the information of the version. Then, I send a web request and get some responses. I want to add some strings that I got from the request to version.description. 

Screenshot 2023-07-11 114425.png

The way I want to do it is the use the concat function for the smart value. I tried to do this {{version.description.concat('{{webhookResponse.body.result}}')}} in "Add value to the audit log" section, but it gave me an error that says 

Log action

Error rendering smart-values when executing this rule:
Failed to get value for version.description.concat('{{webhookResponse.body.result}}') 
Do you know how I should add information that I get from web request to version.description?
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2023

Hi @Sere Walkens 

could you add another "log action" and just print the value you are trying to add with concat?

so just print out the value of the smart value you are using --> {{webResponse.body.result}}  and let´s see what the result is.

 

Best
Stefan

Sere Walkens July 11, 2023

The information I want to add is a string which I can successfully print out in log. It's not the result itself, it's the child of the result. 

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2023

@Sere Walkens i see.

Did you try to add the smart value of the response without the quotation marks?

If this doesn‘t work could you try to first save your part of the response (you‘d like to to concatenate) into a variable and then resolve the variable in your .concat method? (i thought about that bc variables are automatically stored as type string).

Further question:
Did you test without smart value by just concatenate with a string?

Can‘t test right now. Hope I could give some helpful inspiration.

Best
Stefan

Sere Walkens July 14, 2023

 

Yes it helps! I appreciate your help. When I typed {{version.description.concat( webhookResponse.body.result.child)}} it shows the right string. I need to add the smart value without the quotation marks and the double brackets.

 

However, I cannot assign this new value back to {{version.description}}. I didn't find the Create Variable action in New action. 

 

Do you know why I cannot see Create Variable action in New action?

Screenshot 2023-07-11 110742.png

 

Talk soon,

Sere

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 18, 2023

Hi @Sere Walkens 

sorry for the missleading information. I didn´t know it´s on server/data center. Unfortunately the "create variable" is not availabla (currently) on data center but it seems atlassian is already working on it:
https://jira.atlassian.com/browse/JIRAAUTOSERVER-22

As far as you have to use another webRequest to update your version did you try to directly resolve the webResponse directly in your 2nd webrequest that would do the update ?

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/version-updateVersion

 

Best
Stefan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events