Skip to content

Commit 36fa1f9

Browse files
authored
Jira API token is called a 'token', not a 'key'. (#1030)
1 parent 8c8c13c commit 36fa1f9

File tree

1 file changed

+7
-6
lines changed
  • 2nd-gen/app-distribution-feedback-to-jira/functions

1 file changed

+7
-6
lines changed

2nd-gen/app-distribution-feedback-to-jira/functions/index.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const issueLabelConfig = defineString("ISSUE_LABEL", {
2727
description: "Label for the Jira issues being created",
2828
default: "in-app",
2929
});
30-
const apiKeyOwnerConfig = defineString("API_KEY_OWNER", {
31-
description: "Owner of the Jira API key",
30+
const apiTokenOwnerConfig = defineString("API_TOKEN_OWNER", {
31+
description: "Owner of the Jira API token",
3232
input: {
3333
text: {
3434
validationRegex:
@@ -37,8 +37,9 @@ const apiKeyOwnerConfig = defineString("API_KEY_OWNER", {
3737
},
3838
},
3939
});
40-
const apiKeyConfig = defineSecret("API_KEY", {
41-
description: "Jira API key",
40+
const apiTokenConfig = defineSecret("API_TOKEN", {
41+
description: "Jira API token. Created using " +
42+
"https://id.atlassian.com/manage-profile/security/api-tokens",
4243
});
4344

4445
export const handleInAppFeedback = async (event) => {
@@ -50,15 +51,15 @@ export const handleInAppFeedback = async (event) => {
5051
};
5152

5253
export const feedbacktojira =
53-
onInAppFeedbackPublished({secrets: [apiKeyConfig]}, handleInAppFeedback);
54+
onInAppFeedbackPublished({secrets: [apiTokenConfig]}, handleInAppFeedback);
5455

5556
/**
5657
* Creates "Authorization" header value.
5758
* @return {string} Basic, base64-encoded "Authorization" header value
5859
*/
5960
function authHeader() {
6061
return "Basic " + Buffer
61-
.from(apiKeyOwnerConfig.value() + ":" + apiKeyConfig.value())
62+
.from(apiTokenOwnerConfig.value() + ":" + apiTokenConfig.value())
6263
.toString("base64");
6364
}
6465

0 commit comments

Comments
 (0)