Table of Contents |
---|
JipInventory
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
This page is about Assets & Inventory Plugin for Jira DC. Using Cloud? Click here. |
This document describes the data model entities used to represent assets and their associated attributes within AIP.
On this page:
|
---|
Core entities
JipInventory
The main class of asset object. Related classes are listed in on this page. (The asset object is injected to groovy script)into the Groovy script.
Code Block |
---|
package inventoryplugin.entity; import net.java.ao.Entity; import net.java.ao.Implementation; import net.java.ao.OneToMany; import net.java.ao.Preload; import net.java.ao.schema.Indexed; import net.java.ao.schema.StringLength; import java.util.Date; @Preload @Implementation(JipInventoryImpl.class) public interface JipInventory extends Entity { @Indexed JipForm getForm(); @Indexed void setForm(JipForm form); int getSortOrder(); void setSortOrder(int value); @Indexed String getName(); @Indexed void setName(String name); @Indexed String getCustomfieldId(); @Indexed void setCustomfieldId(String customfieldId); @Indexed Long getOptionId(); @Indexed void setOptionId(Long optionId); @Indexed Date getCreated(); @Indexed void setCreated(Date created); String getCreator(); void setCreator(String creator); @StringLength(StringLength.UNLIMITED) String getAttachments(); @StringLength(StringLength.UNLIMITED) void setAttachments(String value); @OneToMany public JipInventoryItem[] getInventoryItems(); } |
...
JipInventoryItem
Attribute values of an asset.
Code Block |
---|
package inventoryplugin.entity; import net.java.ao.Entity; import net.java.ao.Preload; import net.java.ao.schema.StringLength; @Preload public interface JipInventoryItem extends Entity { JipFormAttribute getFormAttribute(); void setFormAttribute(JipFormAttribute formAttribute); @StringLength(StringLength.UNLIMITED) String getValue(); @StringLength(StringLength.UNLIMITED) void setValue(String value); void setInventory(JipInventory inventory); JipInventory getInventory(); } |
JipAttribute
Attribute definition class.
Attribute Type Names: DropdownList, ListBox, ListBoxMultiple, Text, TextArea, RadioButtonList, CheckboxList, DatePicker, DatetimePicker, UserPicker, InventoryList, InventoryListByForm, IP, IPv6, URL; .
Code Block |
---|
package inventoryplugin.entity; import net.java.ao.Entity; import net.java.ao.Implementation; import net.java.ao.OneToMany; import net.java.ao.Preload; import net.java.ao.schema.Indexed; @Preload @Implementation(JipAttributeImpl.class) public interface JipAttribute extends Entity { @Indexed String getAttributeName(); @Indexed void setAttributeName(String name); String getAttributeType(); void setAttributeType(String value); String getPattern(); void setPattern(String pattern); @OneToMany//(reverse = "getAttribute") comes with 0.22.1 version public JipAttributeValue[] getAttributeValues(); } |
JipFormAttribute
Attributes of a form.
Code Block |
---|
package inventoryplugin.entity; import net.java.ao.Entity; import net.java.ao.Preload; @Preload public interface JipFormAttribute extends Entity { public JipForm getForm(); public void setForm(JipForm form); public JipAttribute getAttribute(); public void setAttribute(JipAttribute attribute); public int getSortOrder(); public void setSortOrder(int sortOrder); boolean isRequired(); void setRequired(boolean required); } |
JipAttributeValue
Values (Optionsoptions) of an attribute.
Code Block |
---|
package inventoryplugin.entity; import net.java.ao.Entity; import net.java.ao.Preload; import net.java.ao.schema.Indexed; @Preload public interface JipAttributeValue extends Entity { @Indexed public JipAttribute getAttribute(); @Indexed public void setJipAttribute(JipAttribute attribute); public String getValue(); public void setValue(String value); public int getSortOrder(); public void setSortOrder(int sortOrder); } |
...
JipForm
Main form class.
Code Block |
---|
package inventoryplugin.entity;
import net.java.ao.Entity;
import net.java.ao.Implementation;
import net.java.ao.OneToMany;
import net.java.ao.Preload;
import net.java.ao.schema.Indexed;
@Preload
@Implementation(JipFormImpl.class)
public interface JipForm extends Entity {
@Indexed
String getFormName();
@Indexed
void setFormName(String name);
int getSortOrder();
void setSortOrder(int value);
@OneToMany
public JipFormAttribute[] getFormAttributes();
@OneToMany
public JipInventory[] getInventories();
}
|
AipUtils
Utility functions to use during the post function execution.
Code Block | ||
---|---|---|
| ||
package inventoryplugin.workflow.function.tools; import inventoryplugin.entity.JipInventory; import inventoryplugin.entity.JipInventoryItem; import java.util.List; public interface AipUtils { /** * Get asset attribute by name * @param asset - current asset JipInventory object * @param attributeName - name of the attribute name to look for * @return attribute instance of JipInventoryItem type */ JipInventoryItem getAssetAttributeByName(JipInventory asset, String attributeName); /** * Get asset attribute by id * @param asset - current asset JipInventory object * @param attributeId - name of the attribute id to look for * @return attribute instance of JipInventoryItem type */ JipInventoryItem getAssetAttributeById(JipInventory asset, Integer attributeId); /** * Get attribute value as string by name * @param asset - current asset JipInventory object * @param attributeName - name of the attribute name to look for * @return attribute value as String */ String getAttributeValueAsStringByName(JipInventory asset, String attributeName); /** * Get attribute value as string by id * @param asset - current asset JipInventory object * @param attributeId - name of the attribute id to look for * @return attribute value as String */ String getAttributeValueAsStringById(JipInventory asset, Integer attributeId); /** * get multi attribute value as List by name * @param asset - current asset JipInventory object * @param attributeName - name of the attribute name to look for * @return List of String */ List<String> getMultiAttributeValueAsListByName(JipInventory asset, String attributeName); /** * get multi attribute value as List by name * @param asset - current asset JipInventory object * @param attributeId - name of the attribute id to look for * @return List of String */ List<String> getMultiAttributeValueAsListById(JipInventory asset, Integer attributeId); } |