Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Here how i use the GScript :
Gform ---> GSheet --- > GScript ---> JIRA
In GForm, i took the user e-mail direct from there. And ask for some usual variable (using dropdown menu)
The variable "AssignedSupervisor" was something set in the GForm. So i use the user ID found in JIRA, and
simply re-use that.. exemple, if the user named "Robert Aly" and his Jira User Key is "robert.aly", i simply use
a dropdown field with that value. Once the user finish the form, the script is trigger by the GForm and create the ticket, and send him e-mail contain the JIRA URL to this ticket.
1 or 2 weeks ago... all seem not working. Something seem to have happen, preventing the Script to filled "assignee" and "reporter"
var token64 = Utilities.base64Encode(USER_AUTH + ":" + API_TOKEN);
var headers = {
"content-type": "application/json",
"Accept": "application/json",
"Authorization": "Basic " + token64
};
var searchUsersOptions = {
"content-type": "application/json",
"method": "GET",
"headers": headers,
"muteHttpExceptions": false
};
var searchUsersResponse = UrlFetchApp.fetch(searchUserUrl, searchUsersOptions);
var searchUserResults = JSON.parse(searchUsersResponse.getContentText());
if (searchUserResults.length != 1) {
Logger.log(searchUsersResponse);
throw Error(requesterEmail + " cant find email or more than one find with that email.");
}
var data = {
"fields": {
"project": {
"key": projetkey
},
"priority": {
"name": UrgencePrio
},
"duedate": formattedDate,
"assignee" : {"name" : AssignedSupervisor},
"summary": ProjectNameWithAssignee,
"customfield_12178" : WBSNumberBudgetEst,
"description": Descriptionetdoclink,
"labels" : etiquettesautiliser,
"reporter": {
"emailAdress": requesterEmail
},
"issuetype": {
"name": TaskType
I got those error now
{ [Exception: Request failed for https://mydomainname.atlassian.net returned code 400. Truncated server response: {"errorMessages":[],"errors":{"reporter":"Reporter is required."}} (use muteHttpExceptions option to examine full response)] name: 'Exception' }
Anyone know how to adress those issue ? I give full Admin right to the user attached to the Script, without better result (so it's not a right issue)
I suspect the problem is that user names are no longer supported. See https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/
There wasn an announcement in October 2018 that user names were being deprecated. You need to specify users using their account ID. You can no longer use "name" for user name.
Note that the error you are seeing is about reporter. You specified the reporter using "emailAddress" which is not valid.
You want something like:
"reporter": {"accountId": "abc-1234-def"}
How do i querry the Account ID from e-mail ?
I'm using this que Querry the API with e-mail :
var searchUserUrl = "https://mydomain.atlassian.net/rest/api/2/user/search?username=" + requesterEmail + "&startAt&maxResults&includeActive&includeInactive";
Then search inside (to get the full response)
var searchUsersResponse = UrlFetchApp.fetch(searchUserUrl, searchUsersOptions);
var searchUserResults = JSON.parse(searchUsersResponse.getContentText());
"assignee" : {"accountId" : searchUserResults[0].accountId},
"reporter": {"accountId": ???},
I got no error... but "assignee" not working.
Any idea ?
If i try the API command on the browser, i got some result : https://ourdomain.atlassian.net/rest/api/3/user/search?username=useremail@mydomain.ca&startAt&maxResults&includeActive&includeInactive
If i input manually the AccountID .. it work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found my error...
AccountId instead of AccountID
Everything works fine by using the AccountId instead of the Jira KEY.
Thanks to point me out to that change !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi , I am still not able to update reporter in jira issue. Here is my code :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Pooja Varde are you working with Jira Cloud? I wouldn't expect this to work with cloud. "/rest/api/2/user/search?username="
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.