html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<div id="buttonContainer">
<input type="button" value="Submit" onclick="submitData()">
<input type="button" value="Reset" onclick="clearForm()">
<div>
<label for="bBugId">Delete Bug ID:</label>
<input type="text" id="bBugId" name="bBugId"><br><br>
</div>
<input type="button" value="Delete Row" onclick="deleteRow()">
<div>
<label for="mBugId">M Bug ID:</label>
<input type="text" id="mBugId" name="mBugId"><br><br>
</div>
</div>
<h1 class="textCenter">User Form</h1>
<form id="userForm">
<section class="formSection">
<h2>Mandatory Details Of Bug</h2>
<div class="sectionInner">
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<style>
.hide {
display: none;
}
.tatContainer {
display: none;
}
body {
margin: 0;
background: #f2f2f2;
font-family: sans-serif;
}
h1,
h2 {
color: #594c9b;
}
label {
display: block;
margin-bottom: 5px;
}
/* Styles for all input elements */
input,
select,
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function doGet(){
return HtmlService.createHtmlOutputFromFile('page.html');
}
// Function to Submit the sheet to Database
function submitData(bugdate,bugid,stateOfTheBug,language,u18,bugType,shift,priority,assignee,startTime,reproduceTime,reproducibleBug,regexStartTime,regexTlReviewStartTime,regexTlReviewEndTime,regexEndTime,codePlayScreenshot,clLdap,incidentStartTime,incidentId,incidentSubmissionTime,clNumber,cloneLdap,cfIncidentId,cfClNumber,cfIncidentStartTime,cfIncidentSubmissionTime,clFirstReviewCommentTime,clFirstReviewCommentImplementationTime,clSubmissionTimeAfterFixingAllReviewComments,clLgtmTime,clTlReviewStartTime,clTlReviewEndTime,presubmitErrorsResolvingStartTime,presubmitErrorsResolvingEndTime,lgtmIterations,takedownType,incidentStatus,reviewerRespondDateTime,comments,conductorReceivedTime,bugVerifiedStartTime,bugVerifiedTime,takeDown,violationCategory,remarks,tatForRegexTlReview,tatForRegex,tatForIncidentCreation,tatForIncidentSubmission,tatForClReviewComments,tatForFixingReviewComments,tatForClTLReview,tatForPresubmitErrors,tatForLgtm,tatForPatchCl,tatForConductorMessage,tatForBug,tatForPostLgtmBug,tatForBugVerified) {
Logger.log(bugdate);
Logger.log(bugid);
// Declare a variable and set the reference of active Google Sheet
var myGoogleSheet = SpreadsheetApp.getActiveSpreadsheet();
//var shUserForm = myGoogleSheet.getSheetByName("User Form");
var datasheet = myGoogleSheet.getSheetByName("Database");
var blankRow = datasheet.getLastRow() + 1; // Identify the next blank row
datasheet.getRange(blankRow, 1, 1, 60).setValues([[bugdate,bugid,stateOfTheBug,language,u18,bugType,shift,priority,assignee,startTime,reproduceTime,reproducibleBug,regexStartTime,regexTlReviewStartTime,regexTlReviewEndTime,regexEndTime,codePlayScreenshot,clLdap,incidentStartTime,incidentId,incidentSubmissionTime,clNumber,cloneLdap,cfIncidentId,cfClNumber,cfIncidentStartTime,cfIncidentSubmissionTime,clFirstReviewCommentTime,clFirstReviewCommentImplementationTime,clSubmissionTimeAfterFixingAllReviewComments,clLgtmTime,clTlReviewStartTime,clTlReviewEndTime,presubmitErrorsResolvingStartTime,presubmitErrorsResolvingEndTime,lgtmIterations,takedownType,incidentStatus,reviewerRespondDateTime,comments,conductorReceivedTime,bugVerifiedStartTime,bugVerifiedTime,takeDown,violationCategory,remarks,tatForRegexTlReview,tatForRegex,tatForIncidentCreation,tatForIncidentSubmission,tatForClReviewComments,tatForFixingReviewComments,tatForClTLReview,tatForPresubmitErrors,tatForLgtm,tatForPatchCl,tatForConductorMessage,tatForBug,tatForPostLgtmBug,tatForBugVerified
]]);
}
function deleteRowByBBugId(bBugId) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Database"); // Assuming the sheet name is "Database"
var data = sheet.getDataRange().getValues();
// Assuming the Bug ID is in the second column (index 1) and skipping the header row
for (var i = 1; i < data.length; i++) {
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run