ch.sbb.polarion.extension.excel_importer.EnumUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ch.sbb.polarion.extension.excel-importer Show documentation
Show all versions of ch.sbb.polarion.extension.excel-importer Show documentation
This Polarion extension provides possibility to update (or create) WorkItems using xlsx-file
The newest version!
package ch.sbb.polarion.extension.excel_importer;
import com.polarion.alm.tracker.model.IPriorityOpt;
import com.polarion.platform.persistence.IEnumOption;
import lombok.experimental.UtilityClass;
import java.util.Optional;
@UtilityClass
public class EnumUtils {
/**
* For some options (e.g. 'priority') method getId() returns weird float-like containing strings ("90.0", "50.0" etc.) instead if proper ID.
* Was noticed that proper ID can be accessed from option properties by special key 'standardOptionId'.
*/
public String getEnumId(IEnumOption option) {
return Optional.ofNullable(option.getProperty(IPriorityOpt.PROPERTY_KEY_STD_OPTION_ID)).orElse(option.getId());
}
}