# Shared script function are not found after publishing both project and global

**URL:** <https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768>\
**Category:** Ignition\
**Created:** [July 12, 2017, 6:10am UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768 "2017-07-12T06:10:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [July 12, 2017, 6:10am UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/1 "2017-07-12T06:10:25Z")

</div>

Hi everyone,

Whenever we publish the **Project and Global** , some of the shared script being called on a project script are not found. This is the error :

> 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'api'

The work around is to just publish **Project Only** and the Shared Scripts will be found again.

I found this [topic](http://forum.inductiveautomation.com/t/published-project-cant-find-shared-script-function/10497) with the similar problem, there are only workarounds.

Is there a long term solution for this? Because some of our apps will just stop working if we publish both Project and Global.

Thank you.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [July 12, 2017, 9:11am UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/2 "2017-07-12T09:11:48Z")

</div>

Do you mean it works at first, but when you publish “Project + Global” even without changing a script, it stops working? That would be something new I think.

The issues I know about are caused by not cascading the updates: say module A uses module B, which in turn uses module C. When you then update module C, calling a function on module A will still call the call the old implementation on module C. So the update didn’t cascade through to everything that calls it.

That’s something very annoying, and I moved on to create my own external python library (see [https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/98/2/importing-and-using-3rd-party-python-libraries-in-ignition](https://support.inductiveautomation.com/index.php?/Knowledgebase/Article/View/98/2/importing-and-using-3rd-party-python-libraries-in-ignition) ). I just develop the library in a separate IDE (eclipse + pydev in my case), and wrote a script to copy the files I want to the pylib directory. Do note that also in this case you need to update all files at once, as the updates won’t cascade if you only update one.

Once it’s developed, you can also manually copy-paste everything to Ignition for the final installation, but so far it’s working great as an external library. I also have some other goodies now, like unit tests and version control. The main drawback of this approach is that the script can’t be seen in Ignition, and you need access to the server itself (ssh, file share, remote desktop, …) to alter the script.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [July 12, 2017, 2:02pm UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/3 "2017-07-12T14:02:49Z")

</div>

What version are you using? I thought we had fixed this issue a while ago. :\

---

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [July 12, 2017, 11:10pm UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/4 "2017-07-12T23:10:04Z")

</div>

Hi Sanderd17,

Yes I meant publishing Project and Global without changing a script, it would stop working. So my workaround is publishing again without changing a script but this time only the Project.

That is interesting, we also have third party libraries on the pylib folder but have not encounter any issue yet.

My case might just be a little different, because I am not messing with pylib or other modules, it is just solely on Shared and Project scripts.

---

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [July 12, 2017, 11:10pm UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/5 "2017-07-12T23:10:47Z")

</div>

Hello, we are using 7.8.5

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [July 13, 2017, 1:29pm UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/6 "2017-07-13T13:29:48Z")

</div>

Thanks. I’ll investigate and see if there was a regression. 😳

---

<div class="post-metadata">

**Author:** ![acooper](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/acooper/32/4221_2.png) [@acooper](https://forum.inductiveautomation.com/u/acooper)\
**Post date:** [July 13, 2017, 5:22pm UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/7 "2017-07-13T17:22:30Z")

</div>

Did some research and found that this was a bug that’s been fixed in 7.9. The most recent build (7.9.3) should clear your problem right up! Nice find, and thank you for bringing this to our attention 🙂

---

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [July 14, 2017, 1:02am UTC](https://forum.inductiveautomation.com/t/shared-script-function-are-not-found-after-publishing-both-project-and-global/14768/8 "2017-07-14T01:02:07Z")

</div>

Thank @acooper! We will try 7.9 and keep this thread posted.
