Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Generic post function injects Issue's asset custom fields to the post function context as List<AssetCustomFieldAndValue> with the name assetCustomFieldAndValueList. See examples.

AssetCustomFieldAndValue

...

Class fieldDescription
assetCustomField: See AssetCustomField class on this page below.
customFieldIdassetList

assetList: Gives assets of custom field of the current transition. It's type is List<JipInventory>. See common object types.

fieldNameoriginalAssetList

originalAssetList:  Gives assets of custom field of before transition. It's type is List<JipInventory>. See common object types.


Code Block
languagejava
package inventoryplugin.workflow.function.genericscript.dto;

import inventoryplugin.entity.JipInventory;
import java.util.List;

public class AssetCustomFieldAndValue {

    AssetCustomField assetCustomField;
    List<JipInventory> assetList;
    List<JipInventory> originalAssetList;

    public AssetCustomField getAssetCustomField() {
        return assetCustomField;
    }

    public void setAssetCustomField(AssetCustomField assetCustomField) {
        this.assetCustomField = assetCustomField;
    }

    public List<JipInventory> getAssetList() {
        return assetList;
    }

    public void setAssetList(List<JipInventory> assetList) {
        this.assetList = assetList;
    }

    public List<JipInventory> getOriginalAssetList() {
        return originalAssetList;
    }

    public void setOriginalAssetList(List<JipInventory> originalAssetList) {
        this.originalAssetList = originalAssetList;
    }
}


...

Class fieldDescription
idNumeric custom field id, i.e 11002
customFieldId

String version of custom field id, i.e "customfield_11002"

fieldName

Original name of the field

translatedFieldNameTranslated name of the custom field. It is translated by the current user language preferences.


Code Block
languagejava
package inventoryplugin.workflow.function.genericscript.dto;


import com.atlassian.jira.issue.fields.CustomField;

public class AssetCustomField {

    private Long id;
    private String customFieldId;
    private String fieldName;
    private String translatedFieldName;

    public AssetCustomField() {
    }

    public AssetCustomField(CustomField customField) {
        this.id = customField.getIdAsLong();
        this.customFieldId = customField.getId();
        this.fieldName = customField.getUntranslatedName();
        this.translatedFieldName = customField.getFieldName();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCustomFieldId() {
        return customFieldId;
    }

    public void setCustomFieldId(String customFieldId) {
        this.customFieldId = customFieldId;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getTranslatedFieldName() {
        return translatedFieldName;
    }

    public void setTranslatedFieldName(String translatedFieldName) {
        this.translatedFieldName = translatedFieldName;
    }
}