Versions Compared

Key

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

You can access add-on services from Script Runner add-on. Followings are some example scripts. If you need a script, please let us know, it will be easier to write together. Please inspect JavaDoc of add-on's Java API to get an idea of what is possible. 


Child pages (Children Display)


Code Block
languagegroovy
titleAdding a New Single Select Attribute Value Programmatically
import com.deniz.jira.worklog.services.attr.AttrTypeService;
import com.deniz.jira.worklog.data.attr.AttrValueImp;
import com.onresolve.scriptrunner.runner.customisers.PluginModule;
import com.onresolve.scriptrunner.runner.customisers.WithPlugin;
 
@WithPlugin("com.deniz.jira.worklog")
@PluginModule
AttrTypeService attrTypeService;

//Set properties of attribute we want to add
AttrValueImp value = new AttrValueImp()
value.name = "My New Attribute"
value.description="Test Description"

//add attribute. Returned AttrValueImp has an "id" field which you can use for further method invocations. 
AttrValueImp newValue = attrTypeService.addAttrValueToAttrType(2, value)

...