Managing software licenses with JSM assets (formerly Insight)

Laura Bennett
Contributor
March 14, 2023

I'm attempting to set up a JSM Assets Object Schema and matching JSM Project to manage our company software portfolio.

I have an Object Schema: Software Portfolio and within the schema I have two object types with the following attributes:

  1. Software
    1. Software Name (Text type)
    2. Assignees (Object type. Referencing User)
    3. Total License Count (Integer type)
    4. Available License Count (Integer type)
    5. Owner (User type)
  2. User
    1. Name (Text type)
    2. User (User type)
    3. Software Licenses (Object type. Referencing Software)

On the project side I have a Insight Custom field called Software pulling all Software objects. Employees can use this dropdown field in the JSM portal request screen to select the software they want.

I also have a Insight Custom field called Assignee pulling all User objects where the employee can select the intended assignee of the license.

Once the license has been assigned and the request set to Done I would like some Jira automation magic to be triggered.

  1. Add the value chosen in the Assignee Insight Custom field to the chosen Software's Assignees attribute (this needs to append to the existing attribute value so we can list all Users with a license for Software X)
  2. Calculate the number of used and available licenses by Total License Count - Assignees size.

When an employee leave the company a ticket should be created to unassign the Software licenses associated with that User. So I would need some Jira automation here too:

  1. On ticket creation lookup all Software objects referenced by the User object or  Software Licenses 
  2. When ticket moved to Done clear the specified User from the Software Objects Assignees attribute without removing other User values associated to that attribute.
  3. Calculate the number of used and available licenses by Total License Count - amended Assignees size.
  4. Delete the User object associated to the leaver.

Has anyone configured something similar or written/know of any tutorials that can direct me through how to set something like this up?

From all the training and marketing material I've read up on it seems this is quite a typical use case, but I've been really struggling to get it working.


Particular does anyone know how to append rather than overwritten the attribute values? Even though my Assignees attribute has it's cardinality set to Unlimited it overwrites no matter what I try.

2 answers

0 votes
Malene Vikkelsø
Contributor
August 15, 2024

Hi @Laura Bennett

Did you ever manage to find a solution for this and get it to work?

Laura Bennett
Contributor
October 2, 2024

No, unfortunately not, but I can share my progress here in case it can help someone else.



Step 1: Add the value chosen in the Assignee Insight Custom field to the chosen Software's Assignees attribute (this needs to append to the existing attribute value so we can list all Users with a license for Software X)


I feel I was getting close to a solution but I had an issue with the final step of editing the assets attribute and was getting the error "Attribute value is not valid on Objects".

As a Global Automation rule:

  1. Trigger on transition to Done
  2. Condition on the issue type
  3. Branch on AQL - "Key" = "{{Software}}"
  4. I did a log action to ensure I was pulling all the user keys in the object attribute with my smart value.
  5. Create Variable called {{licenseholders}} with the same smart value {{#object."License Holders"}}{{key}}, {{/}}
  6. Edit Object, edit the License Holders attribute with the variable created above plus the new license holder with the following smart value: {{licenseholders}}{{issue.customfield_#####.Key}} - in this case the customfield was my User asset field.
    Screenshot 2024-10-02 132646.png

As I said this doesn't work, the smart values aren't accepted as valid attribute values however it did show in the log the list of object keys including the new user value from the current issue.


Step 2: Calculate the number of used and available licenses by Total License Count - Assignees size.

I did find an solution for calculating the number of used and available licenses.

As a Global Automation rule:

  1. Trigger when Object Updated
  2. Create variable name {{Total}} from the smart value {{object.Total License count}} - this is a static number field containing the total number of licenses.
  3. Added a log action to confirm the number is pulling correctly.
  4. Edit the Object Attributes:
    1. Used Licenses: {{object.License Holders.size}} - this counts the number of user objects in the license holder attribute
    2. Available Licenses: {{#=}}{{Total}} - {{object.License Holders.size}}{{/}} - calculates the difference between the total and the used license size.


Screenshot 2024-10-02 104958.png


Unfortunately, that's as far as I got, without Step 1 there was little point in investing time into any automations for unassigning.

Like Ojase Emmanuval likes this
MF
Contributor
October 2, 2024

We implemented a similar Use Case. But we use a "Link" ObjectType.

So there are a lot of Software and a lot of Employees.

When a "Software" is assigned to a "User" an entry in "Link" will be created.

Link has a ObjectField for Software,User, (and some other meta informations)

With this setup we are are to do calculations (count user, list of software by user, etc.)

Like Laura Bennett likes this
0 votes
Jose Giron
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2024

Fingers crossed someone out there can help since I want to do something similar !

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events