8

I am aware of the versioning that can be done using "Manage Version". Is there a way available to get/fetch the current version of the Spreadsheet script in/using Apps script .

2 Answers 2

5

If you mean "Can we programmatically retrieve the script version number?", the answer is no. There is an outstanding request for this, in Issue 1369, so visit the issue tracker and star it to indicate your own interest.

Perhaps you mean "Can we programmatically retrieve the most recent source code?"

You can Import and Export Stand-alone script files through the Drive SDK. In Apps Script, this can be accomplished using UrlFetch Services.

There is no way at this time to retrieve the source of container-bound scripts, except through the Script Editor. (See Limitations.)

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I was looking for the way to get the script version number programatically. Thanks for your suggestion I have starred the issue 1369, it was exactly the same I wanted to implement.
0

Reviving a dead one here but others might find this as I have still searching for a solution.

Resolution of Issue 1369 as linked in the other answer is:

Jan 22, 2018 12:09PM 
Marked as fixed, reassigned to [email protected].
As Federico states, with the new Apps Script API you can get script versions.

Also, with the CLI (github.com/google/clasp), you can get version info with:

    clasp versions

this means we can fetch a list of versions but I still have not found a way of programmatically getting the version number and description from within a script.

1 Comment

I think they're suggesting you can use the AppScript UrlFetchApp API (developers.google.com/apps-script/reference/url-fetch/…) to invoke the Apps Script REST API (e.g., developers.google.com/apps-script/api/reference/rest/v1/…) to get the versions of the script. So technically possible, but there are OAuth hurdles to jump through.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.