Hello everyone, I'm trying to make a script automatically assign a person to a custom field but it's not working. What am I doing wrong?
url: xxxx.atlassian.net/rest/api/2/issue/GRD-1152
json content:
{ "fields": { "customfield_10280": "userId" } }
Is the field a user picker (multiple users) or user picker (single user) type?
Moreover, do you have any other field or context where the user name/email is placed?
Basically, you can achieve this with automation, but you have to send Web Request like this:
"xxx.atlassian.net/rest/api/2/user/search?query={{[where the user name is placed].urlEncode}}"
and then to assign the user to your custom field, use this:
{{webResponse.body.first.accountid}}
Happy to help if you need more details!
BR, Maggie
The field is a user selector and has these fields:
"customfield_10280": {
"self": "https://*****.atlassian.net/rest/api/3/user?accountId=*************ff80c38a63f7",
"accountId": "****:******-****-ff80c38a63f7",
"emailAddress": "*****@*****.com",
"avatarUrls": {
"48x48": "https://secure.gravatar.com/avatar/f75d5a8f7ae2aa6f848b963eb5eb3066?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FVM-5.png",
"24x24": "https://secure.gravatar.com/avatar/f75d5a8f7ae2aa6f848b963eb5eb3066?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FVM-5.png",
"16x16": "https://secure.gravatar.com/avatar/f75d5a8f7ae2aa6f848b963eb5eb3066?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FVM-5.png",
"32x32": "https://secure.gravatar.com/avatar/f75d5a8f7ae2aa6f848b963eb5eb3066?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FVM-5.png"
},
"displayName": "Valentino GARCIA MENDEZ",
"active": true,
"timeZone": "America/Argentina/Buenos_Aires",
"accountType": "atlassian"
}
Additionally, the editmeta is as follows:
"customfield_10280": {
"required": false,
"schema": {
"type": "user",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:userpicker",
"customId": 10280
},
"name": "Referente",
"key": "customfield_10280",
"autoCompleteUrl": "https://*****.atlassian.net/rest/api/1.0/users/picker?fieldName=customfield_10280&fieldConfigId=10482&projectId=10175&showAvatar=true&query=",
"operations": [
"set"
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you give some more context of what exactly you are trying to do with this field, i.e. are you trying to assign same user every time based on some conditions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am writing a Python script that, based on certain parameters, assigns that custom field to a person. To test how the PUT request would work, I am trying it out in Postman and it's not working for me yet. For now, I am always testing with the same accountID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
im trying this:
{
"update": {
"customfield_10280": [
{
"set": [
{
"accountId": "712020:1e04ff52-bc5a-4d4d-9aee-fa8eba77718b"
}
]
}
]
}
}
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.