Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I query, from a worksheet cell, the last date and time a =JIRA() function was run?

As a viewer of data returned by the =JIRA() function from Jira Cloud for Sheets, I need to see the date and time that the displayed data was retrieved from Jira so that I can be informed on the timeliness/"Freshness"/age of the data relative to the current date and time. 

 

Example
Cell A1 Last Query Date:      Cell A2 =somefunction()  Cell A3 =JIRA()

1 answer

0 votes
JimmyVanAU Community Leader Sep 29, 2020

Hi Hank,

Great question. This one took a little tinkering, and is a function of the Google sheet, rather than the Jira function itself.

Tweaking https://webapps.stackexchange.com/questions/31894/google-spreadsheet-timestamp/31942#31942, I came up with the following.

In your Google sheet, go to Tools > Script Editor.

Then in Code.gs, try:

function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Sheet1" ) { // only updates relevant sheet
var r = s.getActiveCell();
if( r.getRow() == 3 && r.getColumn() == 1 ) { // only checks for updates in cell A3
var lastUpdatedCell = r.offset(0, -1);
var time = new Date();
time = Utilities.formatDate(time, "GMT", "dd/MMM/yyyy HH:mm:ss");
lastUpdatedCell.setValue(time);
};
};
}

Then run the Jira function in A3 and it should update.

Cheers, Jimmy

For some reason the =Jira() function does not trigger onEdit. Even when I monitor any cell in the sheet. 

OnEdit only runs when a user interacts with the sheet. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - April 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

307 views 3 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you