Thanks for your response.
Yes, I implemented the method in my class.
My test code looks like:
import hudson.model.Action
import hudson.model.Api
import org.kohsuke.stapler.export.ExportedBean
import org.kohsuke.stapler.export.Exported
@ExportedBean
public class myAction implements Action {
private String name;
public Api getApi() {
return new Api(this);
}
public myAction(String name) {
this.name = name;
}
@Exported
public String getName() {
return name;
}
@Override
public String getIconFileName() {
return null;
}
@Override
public String getDisplayName() {
return null;
}
@Override
public String getUrlName() {
return null;
}
}
Then from the pipeline:
currentBuild.rawBuild.addAction(new myAction("actionName"))
In the api/json response I see myAction:
{
"_class": "myAction"
},
but no properties exposed.
I tried defining visibility in @Exported and also increasing depth in the api request but didn't work.