move asset from 'in stock' to 'in use' when related request item is closed

raycallan
Giga Guru

When a requested item is closed the asset linked to the item remains 'in stock' with a sub-state of 'reserved'. We then open the asset and manually change the state to 'in use'.

Ideally I would like this to happen automatically when the related request item is closed.

I would have expected this to be a standard process but I haven't been able to find anything on this in any documentation or searching the topic

Am I missing something obvious or do I need to code in this functionality.

We are currently on Fuji and in the process or upgrading to Helsinki

1 ACCEPTED SOLUTION

larstange
Mega Sage

Hi



you are right - this does not happen automatically out of the box.


you need to apply a script activity to the end of your workflow to set the asset "in use"



Here is what i do:



//Sets the Asset for this Order to "In Use"




var ast = new GlideRecord('alm_asset');


ast.get(workflow.scratchpad.asset);




ast.install_status = 1; //In use


ast.substatus = '';


ast.assigned_to = current.request.requested_for;


ast.stockroom = null;


ast.update();


View solution in original post

6 REPLIES 6

larstange
Mega Sage

Hi



you are right - this does not happen automatically out of the box.


you need to apply a script activity to the end of your workflow to set the asset "in use"



Here is what i do:



//Sets the Asset for this Order to "In Use"




var ast = new GlideRecord('alm_asset');


ast.get(workflow.scratchpad.asset);




ast.install_status = 1; //In use


ast.substatus = '';


ast.assigned_to = current.request.requested_for;


ast.stockroom = null;


ast.update();


Hi Lars,



Thanks for getting back to me. How or where are you setting the value   'workflow.scratchpad.asset' or is it set automatically?



I'm using the procurement fulfilment process


  • Request lines for Hardware devices are fulfilled either by transfer orders or purchase orders
  • Request lines for Consumable items are fulfilled by transfer orders


Ray


workflow.scratchpad.asset is undefined,  how can I get asset in my workflow. We are using Procurement Process Flow - Hardware 

Community Alums
Not applicable

Ray,


What I typically recommend is to have a Workflow that is used to prepare the item for use. This could include steps to load an operating system and software or some other steps for preparation. This would be attached to the requested item. The last Activity in the Workflow would make this final change in the State of the Asset. This allows you to track the preparation and delivery and automates the management of the State as part of the overall process.



Ben