Hi everybody.
I really need help with solving the following problem. The function works in the cloud: "{{addedfieldChange.valueIds}}". But this does not work in the Data Center. The task is as follows. Users add other users to the Multiple user Picker type field. I need to track the change of this field and get the value that was added in order to add or remove it from other similar fields. But I can't get the value that was added by using {{fieldChange.fromString}} and {{fieldChange.toString}} .
Hi @Mari Pervushina
I am using Jira Cloud, and so cannot test my suggestions with Jira Data Center, so please test with your rules. With that out of the way...
I recall the scenario you describe for Jira Data Center is difficult to solve because the changelog information available to automation rules is different from Jira Cloud's rules.
First, let's confirm if your rule has what it needs to solve this. Please create the following test rule, run it with a test issue, and post what you see in the audit log details:
From String values: {{#changelog.your Custom Field From The Trigger}}{{fromString}}{{/}}
From values: {{#changelog.your Custom Field From The Trigger}}{{from}}{{/}}
To String values: {{#changelog.your Custom Field From The Trigger}}{{toString}}{{/}}
To values: {{#changelog.your Custom Field From The Trigger}}{{to}}{{/}}
If these correctly list the selected name changes, we can then create a rule using created variables with text functions to get the added and removed values isolated.
Kind regards,Bill
Please check similar issue described here
Best regards
Sam
Hello @Samuel Gatica _ServiceRocket_
Thank you for you advice. I wrote my question in here.
There is no answer to my question right now and this topic about cloud instead my problem only for data center.
Hello @Mari Pervushina
When you ask for help with an Automation Rule, in order for us to provide help we need you to provide the following:
1. Screen images that show your entire rule and the details of each step.
2. The details from the Audit Log for an execution of the rule.
I need to get added values for multipl users-picker field, i need the value of difference between From and To as username. My automation bellow.
///
And the variable StudentName = {{fieldChange.toString.diff(fieldChange.fromString)}} returns Empty, see log bellow.
I understand that the variable {{fieldChange.fromString}} returns a string and it will not be possible to use a minus or a difference here. But I don’t know what I can use.
The diff() function only applies for date and date / time values, and not for text: https://confluence.atlassian.com/automation/jira-smart-values-date-and-time-993924864.html#Jirasmartvaluesdateandtime-diffdiff(date)
Thank you @Bill Sheboy for your attention to my problem.
I did two tests. In the first one, I had an empty field and added one value "test user". In the second test, I added two values Mari and Jira Admin to the same field. And this is what is in the logs.
Нere are two more field changes. As you can see, the row is inserted according to alphabetical order.
Thanks for that information! Here are two more tests to confirm the behavior before we try the rule:
GIVEN there are several users selected in the fieldWHEN one user is removedTHEN that user is in the from changelog valueAND that user is not in the to changelog value
GIVEN there are several users selected in the fieldWHEN all users are removedTHEN all the users appear in the from changelog valueAND no users appear in the to changelog value
Please try those and post the results.
Hello everyboody!
Another problem confronted me. I will describe it in a separate thread, maybe it will be useful to someone else.
Some users have user name = Full name, I tested it on them and everything was fine. But now I see that my method described above does not work if the user has user name = email. I was thinking of trying to use To/From instead of StringTo/From, but the id part contains ":" and that seems to be the problem. Then I decided to use a webhook request to receive the user name and then work with it. I know how to do this in automation using the standard "Send web request" function and am now looking for a way to do it in a loop.
First I try to use custom data. And I have no idea why this doesn't work?
I used this article
https://confluence.atlassian.com/jirakb/how-to-send-a-webhook-from-an-automation-rule-using-assets-object-data-1130372732.html
You appear to be calling the Jira REST API endpoint for Find Users. Is that correct?
https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/user-findUsers
If so, please try passing the query parameters on the URL rather than using custom data. This one worked for me with Jira Cloud and I suspect it is similar for Data Center.
yourJiraURL/rest/api/2/user/search?query=username="{{fullName}}"
Hello @Bill Sheboy , you are right, this is working. But my plan was to pass the variable not in the url line, but in "Custom data", so that in my case it would be possible to get the username for several users one by one.
It looks like you're new here. Sign in or register to get started.