GAS不允许在团队云端硬盘中创建可安装的触发器 [英] GAS doesn't allow pragrammably create installable trigger in Team Drive

查看:102
本文介绍了GAS不允许在团队云端硬盘中创建可安装的触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司一直在尝试使用G Suite在线移动我们的流程。
出于某种原因,GAS不允许我设置触发器并返回异常:不允许操作。见下面的截图1-3。



[要求授权] [1] // SO不允许我发布两个以上的链接,这是一个截图告诉您脚本需要授权并要求您选择一个帐户。



允许访问



动作不允许



最简单的代码:

  function myFunction(){
Logger.log(Trigger created);


函数createTrigger(){
ScriptApp.newTrigger(myFunction)
.forSpreadsheet(SpreadsheetApp.getActive())
.onEdit )
.create(); //这行不会被执行

code $



  1. 这只发生在存储在Team Drive中的文件(独立和绑定脚本)中,在我的云端硬盘中效果很好

  2. 我可以去编辑 - >当前项目的触发器并手动设置一个开启编辑触发器
  3. 它与域授权有关,但找不到任何有用的信息。

  4. 我与Google Cloud Support聊天但没有运气。部分回复:




感谢您联系G Suite支持。我了解到,您遇到的脚本问题不属于gsuite.google.com/terms/user_features.html定义的核心G Suite服务套件的一部分。



您遇到的问题目前超出了我们的支持服务范围,我们目前无法为您提供进一步的直接帮助。


由于这种情况发生在团队驱动器中,因此我无法提供指向该文件的链接。



任何帮助将不胜感激。



预先感谢!

解决方案

团队云端硬盘文件由团队拥有并且不能由单个用户授权。我还没有找到关于如何缓解这个问题的新文档,这就是为什么我们仍然在共享Google云端硬盘文件夹中管理基于团队的脚本。


My company has been trying to move our processes online using G Suite. For some reason, the GAS wouldn't allow me to set up a trigger programmably and returns an "Exception: Action not allowed". See below screenshots 1-3.

[Asking for authorization][1] //SO doesn't allow me to post more than two links, this is a screenshot that tells you the script needs authorization and asks you to select an account.

Allow Access

Action not allowed

Simplest code:

function myFunction() {
  Logger.log("Trigger created");
}

function createTrigger(){
  ScriptApp.newTrigger("myFunction")
  .forSpreadsheet(SpreadsheetApp.getActive())
  .onEdit()
  .create();//this line wouldn't be executed
}

The observation/tries I had so far are:

  1. This only happens in files(standalone and bound scripts) stored in Team Drive, works well in My Drive
  2. I can go to Edit -> Current Project's Triggers and manually set up an On edit trigger
  3. I'm guessing it has something to do with domain authorization but couldn't find any useful information
  4. I had a chat with Google Cloud Support but had no luck. Part of their response:

Thank you for contacting G Suite Support. I understand that you are experiencing an issue with Scripts that is not part of the core suite of G Suite services defined at gsuite.google.com/terms/user_features.h.t.m.l.

The issue you’ve experienced is currently outside the scope of our support offering and we won’t be able to offer you further direct assistance at this time.

Since this happens in team drive, I'm not able to provide a link to the file.

Any help will be appreciated.

Thanks in advance!

解决方案

Team Drive files are "owned" by the team and cannot be authorized by a single user. I've not found new documentation on how to mitigate this problem which is why we still manage team-based scripts in shared Google Drive folders.

这篇关于GAS不允许在团队云端硬盘中创建可安装的触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆