Add a comment in Rovo action

Hi there,

feeling kind of dumb, while writing this… we simply want to add a comment in a Rovo action.

The problem comes with the required ADF (Atlassian Document Format) of the add comment REST API. Our agent is unable to deliver valid ADF. And I can’t use the provided atlaskit transformers (e.g. @atlaskit/editor-markdown-transformer) in the Forge backend.

Any idea how to do this? Could you provide a working example (with more than just a one line text)? Would it be possible to enable Rovo agents to provide valid ADF?

Thanks in advance!

Hi @paul ,

Just to clarify, is the problem that:

  1. You can’t seem to format the comment ADF correctly at all.
  2. You can’t format the comment ADF using a supported library such as @atlaskit/editor-markdown-transformer?
  3. You can create comments using the V3 API, but is doesn’t work when invoked from a Rovo Action
  4. Something else or a combination of the above.

Regards,
Dugald

1 Like

@dmorrow I think you have ATed the wrong person
Paul

3 Likes

Sorry @paul , my response was meant for @ppasler .

1 Like

@paul thanks for clarifying :slight_smile:

Hi @dmorrow

  1. You can’t seem to format the comment ADF correctly at all.

I can only parse it “by hand”, which I want to avoid. The Rovo agent is not capable to provide valid ADF to the action.

  1. You can’t format the comment ADF using a supported library such as @atlaskit/editor-markdown-transformer?

I can’t use the library in the Forge backend. I’ll get a warning while deployment and the action returns with an error (without any logs).

Forge backend

import {MarkdownTransformer} from "@atlaskit/editor-markdown-transformer";

...

export function someAction() {
	console.log(">>>do something");
	const markdownTransform = new MarkdownTransformer(schema);
...
}

Deployment (--verbose doesn’t provide any further hints)

...
ℹ Packaging app files
⚠ Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
⚠ Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
ℹ Uploading app
ℹ Validating manifest
...
  1. You can create comments using the V3 API, but is doesn’t work when invoked from a Rovo Action

I can create comments, but only if I use valid ADF. Plaintext (or Markdown) is not accepted.

  1. Something else or a combination of the above.

So it’s a combination :slight_smile:
What I want is to add a comment in an action with the content provided by an agent. The content is more than a one line sentence. All of the examples I’ve found use the V2 API and contain only a simple sentence.

How would you do such a task?
Thanks in advanced!

Hi @ppasler ,

Let’s start with:

The Rovo agent is not capable to provide valid ADF to the action.

Have you created an action that has an input parameter like commentAdf which you’ve instructed Rovo format as ADF? If so, I think is would be better to specify input parameters for each field you want the comment to contain and then have your app compose these fields into ADF. If I’m on the wrong track, please provide specific details such as code that demonstrates your problem.

Regards,
Dugald

1 Like

Hi @dmorrow,

Yes, I initially tried instructing the Rovo agent to send valid ADF to the action, but it didn’t work. Based on that, I assumed Rovo might not support this directly - though it would be a useful extension.

Given this, I believe implementing transformers in the Forge backend within the action itself would be simpler. However, I’m open to any approach that allows me to write “longer,” formatted text as a comment in my action. Since these texts are not standardized, creating a template ADF and filling it with parameters wouldn’t be very helpful in this case.

Cheers,
paul

1 Like

The Atlaskit component also doesn’t produce a complete rendering of ADF (I think it doesn’t do any images). That is also causing issues with the migration to version 3 of the cloud REST API. Atlassian need to provide a complete renderer for ADF

2 Likes

I completely agree - a utility library for converting Markdown or HTML to ADF and vice versa would be fantastic! In my case, the Atlaskit Markdown transformer’s capabilities would suffice, but unfortunately, it doesn’t work in the Forge backend.

But is there markdown support in the v2 REST API?

Hi @ppasler and @paul ,

You both make good points. Our support of ADF is poor. At the heart of this issue is that we don’t provide a publicly supported ADF parser (Editor markdown transformer is not publicly supported) so that it can be used within a Forge app, but going further and supporting ADF typed action input parameters would be also great.

For now you have two options:

(a) Continue to build ADF from action input parameters using the ADF builder or template strings; or
(b) Avoid ADF and use version 2 of the Jira REST API.

Regards,
Dugald

1 Like

Thanks @dmorrow for confirming.

I agree about the need for ADF support and believe this goes beyond just support in Rovo actions. Are you aware of any efforts to address this? Could you share any related issues or information about the roadmap?

In the meantime, I think I’ll parse the agent’s response myself and construct valid ADF from it.

Thank you for your support!