Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to integrate Jira and google docs?

NewByatl
Contributor
November 9, 2023

Hi! I'm trying make this:

Create issue if column D in https://docs.google.com/ was edited

So it is done, but I have no idea how to create issue and copy information in task from column C (from same row)

 

Example: IF column D and which row 12 (or 13 or 14, it doesn't matter) was edited, THEN issue created and description contains information from  column C and row 12 (or 13 or 14, it doesn't matter)

 

issue created because works this script in GD:


function editRow(e){
if(e.changeType=="EDIT" || e.changeType=="INSERT_ROW"){ //The type of change (EDIT, INSERT_ROW, INSERT_COLUMN, REMOVE_ROW, REMOVE_COLUMN, INSERT_GRID, REMOVE_GRID, FORMAT, or OTHER)
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); //get activated Spreadsheet
var sheet = spreadsheet.getSheetByName("Sheet1"); //get sheet by sheet name
var headings = sheet.getDataRange().offset(001).getValues()[0]; //get heading
var column_to_watch = 5//A=1, B=2, C=3 etc...
var row = sheet.getActiveRange().getRow();
var column = sheet.getActiveRange().getColumn();
if (e.changeType=="EDIT" && column != column_to_watch)
return;
var values = sheet.getSheetValues(
row// starting row
1// starting column
1// number of rows
4 // number of columns
);
var payload ={}
for (i = 0i < headings.lengthi++) {
var name = headings[i];
var value = values[0][i];
payload[name] = value;
}
payload["row_number"] = row;
var options = {
'method''post',
'contentType''application/json',
'payload'JSON.stringify(payload)

};
}
}
and automation for jiraimage.png

 


What I sholud add to realize this feature?

1 answer

0 votes
Darryl Lee
Community Champion
November 13, 2023

Hey this is neat. Where'd you get this script? Did you write it yourself?

I think I'd need to see an example of what the sheet looks like, because I'm not sure what the headings are, which I guess would dictate the fields you are submitting to Jira.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events