Adding and Moving Assets Using AutoTasks

There may be some circumstances where assets need to be organized from their original folder location, and you don't want to need to manually manage each change. The following AutoTasks are a few examples that will automatically reorganize assets based on your specific match criteria, avoiding the need for any administrative intervention.

Moving uploaded assets based on groups

In the following AutoTask, new assets uploaded to a certain folder are moved to a designated folder – but only if that asset is uploaded by a member of a specific NetX group, 

<task name="Move User Imports">
  <matchCriteria type="and">
    <criteria type="action" value="import"/>
    <criteria path="Asset dumpster" recursive="true" type="category"/>
    <criteria name="Relegate" type="group"/>
  </matchCriteria>
  <modifications>
    <modify path="Relegated assets" type="category" value="move"/>
  </modifications>
</task>

matchCriteria

This AutoTask triggers when any file is uploaded to the folder Asset dumpster (or any of its subfolders, given the recursive parameter), and that user is a member of the group Relegate.

modifications

Once the task is triggered, the subsequent asset(s) are moved to the folder Relegated assets

Moving assets based on attribute value

The following task moves existing assets to a specified folder if anyone changes a specific attribute to a specific value in any metadata-editing context.

<task name="Move to In Process">
	<matchCriteria type="and">
    	<criteria name="Publication status" type="attributeChange"/>
    	<criteria name="Publication status" type="attribute" value="Ready for publication"/>
  </matchCriteria>
  <modifications>
		<modify path="Originals/Drafts/Final" type="category" value="move"/>
  </modifications>
</task>

matchCriteria

This AutoTask triggers when the attribute Publication status is changed to Ready for publication

modifications

Once the task is triggered, the affected asset(s) are moved to the folder /Originals/Drafts/Final

Adding assets based on attribute value

The following task adds existing assets to a specified folder if anyone changes a specific attribute to a specific value in any metadata-editing context. Adding an asset to a folder preserves its original folder location as well as putting it into a second folder, as opposed to moving the asset from the existing folder into a new folder entirely.

<task name="Add asset to Category">
    <matchCriteria type="and">
        <criteria name="Review Status" type="action" value="attributeChange"/>
        <criteria name="Review Status" type="attribute" value="In Process"/>
    </matchCriteria>
    <modifications>
        <modify path="In Process" type="category" value="add"/>
    </modifications>
</task>

matchCriteria

This AutoTask is triggered when the attribute Publication status is changed to Ready for publication

modifications

Once the task is triggered, the affected asset(s) are added to the folder Originals/Drafts/Final

Moving assets and creating a new folder

The following task moves existing assets to a specified folder if anyone changes a specific attribute to a specific value in any metadata-editing context. If the folder does not exist when the task is triggered, the task will create the folder rather than fail. 

<task name="Add asset to Category">
    <matchCriteria type="and">
        <criteria name="Campaign" type="action" value="attributeChange"/>
        <criteria name="Campaign" type="attribute" value="Autumn 2021"/>
    </matchCriteria>
    <modifications>
        <modify type="category" path="Campaigns/Autumn 2021" value="move" mkdir="true"></modify>
    </modifications>
</task>

matchCriteria

This AutoTask is triggered when the attribute Campaign is changed to Campaigns/Autumn 2021

modifications

Once the task is triggered, the affected asset(s) are moved to the folder Campaigns/Autumn 2021. If the folder Autumn 2021 does not exist at the time the task is triggered, a new folder will be created using the mkdir parameter before the asset(s) are moved.

 

 

 

Was this article helpful?
0 out of 0 found this helpful