# \[BUG\] Ignition 8.0.16-RC1 - system.util.audit - auditProfile mandatory for runscript in tag expression

**URL:** <https://forum.inductiveautomation.com/t/bug-ignition-8-0-16-rc1-system-util-audit-auditprofile-mandatory-for-runscript-in-tag-expression/37723>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [August 14, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/bug-ignition-8-0-16-rc1-system-util-audit-auditprofile-mandatory-for-runscript-in-tag-expression/37723 "2020-08-14T13:18:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 14, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/bug-ignition-8-0-16-rc1-system-util-audit-auditprofile-mandatory-for-runscript-in-tag-expression/37723/1 "2020-08-14T13:18:32Z")

</div>

**Ignition 8.0.16-RC1**

I use a gateway expression tag with a runscript expression to log some audit.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d7e18ec8c22a07f767588ef66cb6f94cdb6d2699.png)

If I don’t provide the auditProfile to system.util.audit, I have an error.  
The gateway audit profil seem to be ignored in this case.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96b07714e439183e57ecd4f297790ed0a645a357.png)

```auto
system.util.audit(action = "gateway activity level", actionTarget = ("%s => %s" % (role,activityLevel)))

```

```auto
Fct: 'shared.commun.audit.addAuditGatewayRole' Contexte: Type='<type 'exceptions.ValueError'>' Err='audit(): No audit profile provided or found for the project' Stack=Traceback (most recent call last): File "<module:shared.commun.audit>", line 194, in addAuditGatewayRole ValueError: audit(): No audit profile provided or found for the project

```

with:

```auto
system.util.audit(auditProfile = "audit", action = "gateway activity level", actionTarget = ("%s => %s" % (role,activityLevel)))

```

**All is fine**

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [August 14, 2020, 9:38pm UTC](https://forum.inductiveautomation.com/t/bug-ignition-8-0-16-rc1-system-util-audit-auditprofile-mandatory-for-runscript-in-tag-expression/37723/2 "2020-08-14T21:38:38Z")

</div>

Given the error you are receiving and the fact that you are calling a project script, it sounds like the project that contains the ‘shared.common.audit.addAuditGatewayRole’ script method is missing a project level audit profile.

From my understanding, the runScript() expression function will run in the scope of the Gateway Scripting Project instead of the gateway scope unless the Gateway Scripting Project is empty despite it being a tag. Your expression in particular _has_ to run in project scope as it is calling a project level script as well.

However, in the case that your Gateway Scripting Project is set to nothing, then you can do an expression such as `runScript('system.util.audit(action = "gateway activity level")` which will then use the Gateway Audit Profile as it will not have a project to be in scope of. But, the moment the Gateway Scripting Project is filled, then it will run in that project’s scope even if you do not call a project script from that expression.
