I have created a custom content type and now I want to use Confluence-REST to assign comments or properties to it. There is always an error that this type is not supported, is there a possibility that REST can use or do I have to build one myself?
Can you double check your implementation of the ```ContentTypeApiSupport``` class
You should have the method ```supportsChildrenOfType``` implemented
@Component("communityApiSupport")public class CommunityApiSupport implements ContentTypeApiSupport<CustomContentEntityObject> {private static final String COMMUNITY_TYPE_KEY = "atlassian.confluence.community:community-type"; private final CustomContentManager customContentManager; private final SpaceManager spaceManager; @Autowired public CommunityApiSupport(@ComponentImport final CustomContentManager customContentManager, @ComponentImport final SpaceManager spaceManager) {this.customContentManager = customContentManager; this.spaceManager = spaceManager; }@Override public ContentType getHandledType() {return ContentType.valueOf(COMMUNITY_TYPE_KEY); }@Override public boolean supportsChildrenOfType(ContentType contentType) {return contentType.in(ContentType.ATTACHMENT, ContentType.COMMENT); }...}
That tells the custom content API that comments are allowed on your custom type, therefore everything works as expected. For a sample implementation please have a look at https://bitbucket.org/viqueen/confluence-community/src/ad754ddc59b08746fa0a37d4122c3aadd924b261/src/main/java/com/atlassian/confluence/community/type/CommunityApiSupport.java?at=master&fileviewer=file-view-default#CommunityApiSupport.java-63
Hope this helps
Hasnae R.
It looks like you're new here. Sign in or register to get started.