I want an automation rule that uses 'Manual Trigger' and on clicking on that trigger a single user type custom field will get populated with the current username(User who trigered the event). I am currently using an automation rule where as Action I have used smart value with the following JSON:
{
"fields": {
"customfield_14901": {{initiator.accountId.asJsonObject("id")}}
},
}
But this is throwing error and even if it runs successfully the field is not updated. Can anyone please guide me towards the correct JSOn format to achieve this?
FYI: Using Jira Datacenter instance
Hi Soham,
What happens if you remove the asJasonObject part?
Hi John,
In the audit logs I see it as a success but the custom field is not populating with any value. I removed the "asJsonObject" part. Used this instead:
{
"fields": {
"customfield_14901": { "id": "{{initiator.accountId}}" }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe try this:
{
"fields": {
"customfield_14901": { "id": {{initiator.accountId.asJsonString}} }
},
}
If that doesn't work, try changing out your customfield value with assignee and see if that works. If so, then there is an issue with your custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Soham Das
I believe your syntax was initially correct however, you're in data centre. So I'm not sure what the field name should be.
If you have a look at:
YOUR_SERVER_ADDRESS/rest/api/2/myself
You should see all the fields of a user, then follow that structure. It might username in server? Its been awhile since we forked and I'm hazy on server these days.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.