How do I get the application version number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 03:36 AM
I want to display the scoped application version number on a Programmatic Content Block so I need a way to get it using jelly scripting (if possible).
To be clear I mean the version of our scoped application which is installed on their SN instance, not the version of ServiceNow or anything like that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 03:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 07:02 AM
Great, that works, but it would be nice not to have to find the record that refers to the current app. Is there a scoped sys property for the current app's sys id or something?
Here's what I have now:
<g2:evaluate var="jvar_version">
var grSysApp = new GlideRecord('sys_app');
grSysApp.addQuery('name', 'STARTSWITH', 'Sync Services');
grSysApp.addQuery('scope', 'x_suel_asset_meta');
grSysApp.query();
var version = '';
if (grSysApp.next()) {
version = 'Version ' + grSysApp.version;
}
version;
</g2:evaluate>
<p class="version">$[jvar_version]</p>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 06:29 PM
If you wanted to use a property for your custom app, you would need to make it a standard part of your app and manage it separately from the Version field. Sounds a bit like a duplicate effort. Adding your code to a script include and just calling a method like "getVersion()" might make it easier to manage in your Jelly code (as well as other places.) Just a thought.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2016 03:19 AM
Sadly that solution fails once the app is installed somewhere as sys_app is empty on the target instance