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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.