-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we reference the custom functions in a Google Apps Script? #216
Comments
Im not aware of any way, where you can use the add-ons functions within your own script as if they would be defined inside yours. What does work is, setting cell values with such custom functions from within your own script, ie:
May i ask, what you try to achive - maybe there is a easier way. |
Hi @ljay79, We have a dashboard in gSheets that pulls data from Jira for many projects we're working on. There are two dimensions (workstream and acquisition). We currently have 13 workstreams and 32 acquisitions (which will grow at a rate of 1 per week). We calculate the %-age completed and if an an issue exists we add a Jira link that gets displayed with the status and %-age. The formula for each cell in the matrix is this one: =if("NA"=vlookup($A3,AuxProgress!$A$1:$Z,1+match(G$1,AuxProgress!$B$1:$Z$1,0),false),"NA",if(1=vlookup($A3,AuxProgress!$A$1:$Z,1+match(G$1,AuxProgress!$B$1:$Z$1,0),false), "Completed (100%)", if(JST_getTotalForSearchResult("project=IMPFAILURES AND Workstream='"&G$1&"' and Priority=Showstopper AND Acquisition ='"&$A3&"' and status not in ('Closed', 'Implemented', 'Cancelled')")>0 ,hyperlink("https://jira.servername.com/issues/?jql=project%3DIMPFAILURES%20AND%20Workstream%3D%27"&G$1&"%27%20and%20Priority%3DShowstopper%20AND%20Acquisition%20%3D%27"&$A3&"%27%20and%20status%20not%20in%20(%27Closed%27%2C%20%27Cancelled%27%2C%20%27Implemented%27)","Blocker" & " (" & Text(vlookup($A3,AuxProgress!$A$1:$Z,1+match(G$1,AuxProgress!$B$1:$Z$1,0),false),"0%") &")"),if(JST_getTotalForSearchResult("project=IMPFAILURES AND Workstream='"&G$1&"' and Priority=High AND Acquisition ='"&$A3&"' and status not in ('Closed', 'Implemented' , 'Cancelled')")>0,hyperlink("https://jira.servername.com/issues/?jql=project%3DIMPFAILURES%20AND%20Workstream%3D%27"&G$1&"%27%20and%20Priority%3DHigh%20AND%20Acquisition%20%3D%27"&$A3&"%27%20and%20status%20not%20in%20(%27Closed%27%2C%20%27Cancelled%27%2C%20%27Implemented%27)","Issue" & " (" & Text(vlookup($A3,AuxProgress!$A$1:$Z,1+match(G$1,AuxProgress!$B$1:$Z$1,0),false),"0%") &")"), "On Track (" & Text(vlookup($A3,AuxProgress!$A$1:$Z,1+match(G$1,AuxProgress!$B$1:$Z$1,0),false),"0%") &")")) )) Any suggestions? |
Hmm looks quite complicated. Honestly, im not sure if i entirely understand the use case. What i notice it, you use the add-ons custom functions directly in some of your formulas. This way, you have better separation of logic, code and data which also make the formulas much more readable. In case you are concerned about updated results from the custom functions. |
We'd like to trigger a periodic refresh of the custom functions and the issue tables. Are we able to add your libraries into our Google Apps Script to call your functions like RefreshIssueTable? |
Sry, but the add-on is not available for libraries import. To refresh any regular custom function in a sheet you can call
If you can describe what kind of custom results you would require to work with your usecase, i can take a look if i might be able to support such in the add-on. |
Btw: This add-on is open source, if you really want to start creating custom scripts for you usecase, there is the the option to adopt/use the code available here in the repository to create you own add-on/script. |
How can we use the custom functions in a Google Apps Script? We have some very long formulas and looking for an easier way to manage them, using a script would make more sense for us.
Thanks,
Jeff
The text was updated successfully, but these errors were encountered: