Hi,
Im trying to write a script to create a Jira Issue, when a User fills out a GoogleForm
I keep getting the following error
here is my code
The fields Project, Summary, Description and Issue Type exist in my Workspace
Can anyone help me ?
thanks
Phil
Any one know how to use the API method instead ? This one as been anounce as "phase out" starting July 2019... so it won't work very fast.
As far as I know, you can use your e-mail address as user name and generate an API Token on your Jira account that serves as password. Works for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Phil Walburn,
POST URL seems wrong. It should be like "....../rest/api/2/issue".
Here is the link; https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issue-post
Tansu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Phil Walburn This is something I have just started looking at however my Apps Script knowledge is somewhat limited at the moment - is there anyway you would be willing to share your code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phil,
Can you share your brilliance, I'm struggling here because of the 401 error. can you share the code it will be much appreciated.
Thanks,
Kannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kannan,
try something like this
Phil
// Set the Jira Credentials
var username = "YOUR USER NAME"; // <=========================== Set your Username here
var password = "YOUR PASSWORD"; // <=========================== Set your Password here
var UserCredentials = "Basic " + Utilities.base64Encode(username + ":" + password);
var IssueURL = "https://YOUR JIRA URL GOES HERE/rest/api/2/issue"; // <=========================== Set your Jira URL here
var IssueData = {"fields":
{"project": { "key": "ProjectCode" }, // Set the Project
"summary": Summary, // Set the Summary
"description": Description, // Set the Description
"issuetype": {"name": "Enhancement"}, // Set the Enhancement
"priority": {"name": Priority}, // Set the Priority
"customfield_xxxxx" : { "value": "Fieldvaluegoeshere"}
"customfield_xxxxx" : { "value": "Fieldvaluegoeshere"}
}
};
// Call the Jira API
var payload = JSON.stringify(IssueData);
var headers = {"Accept":"application/json",
"Content-Type":"application/json",
"Authorization": UserCredentials,
"muteHttpExceptions": "True"
};
var options = {"method":"POST",
"headers": headers,
"payload" : payload
};
var response = UrlFetchApp.fetch(IssueURL, options);
// Parse the JSON response to use the Issue Key returned by the API in the email
var dataAll = JSON.parse(response.getContentText());
var issueKey = dataAll.key
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Phil,
Is there a way, such that we can create sub-task for the created Jira ticket. Can you please help on this, I'm new to the scripting.
Kannan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does anyone know how to use information that you pull from your spreadsheet for your
var data = {"fields": ?
In general the script works. As soon as I add variables that refer to my spreadsheet it doesn't work though.
My code looks like this
Thanks
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.