Missing context Pieces in Action Module's Function and Workarounds

Hey there,

While building our first Rovo integration for Barcelona, I stumbled across missing pieces of information in the context of a function invoked from an action module.

Overall Context Availability
It appears the context value is only available when Rovo is invoked from a few specific places in Jira. When the action is invoked from an Issue View, the following context is available:

"context": {
    "jira": {
      "url": "https://hello.atlassian.net/browse/C2-16",
      "resourceType": "issue",
      "issueKey": "C2-16",
      "issueId": "18427",
      "issueType": "Task",
      "issueTypeId": "10005",
      "projectName": "c2",
      "projectKey": "C2",
      "projectId": "10008"
    }
  }

This is not the case when the action is invoked from the board view, project settings, list view, and so on, even though those views can clearly be associated with a projectId. In our first simple use case, we want to allow the user to find project, issue, or board templates via Rovo. We’d like to prioritize more useful search results, which is why the projectId would be helpful.

Overall Documentation and Typing
As soon as Atlassian is sure what types of context are available for the different scenarios, better documentation of which fields to expect where would be appreciated. The same goes for proper typing in the corresponding @forge packages.

cloudId / siteUrl
We want to provide the user with links that direct them to the right place within our app. Therefore, we need to build a fully qualified URL, which we construct from the appId, the environmentId, and the siteUrl. Luckily, getAppContext() works in the action, but it does not contain the siteUrl. I believe siteUrl and cloudId should be part of every invocation, as they should always be defined and would important use cases like the one outlined above.

Workaround
For the siteUrl, it sometimes helps if the siteUrl is part of the input populated via the LLM, which looks like this in our case:

      inputs:
        siteUrl:
          title: The site url of the Jira instance
          type: string
          required: true
          description: The site url of the Jira instance.

This feels shaky, as the URL is not always provided. With the projectId or projectKey, it doesn’t work at all. I suggest that Atlassian extend the context to enable more powerful use cases.

Best,
Julian

1 Like

Hi @JulianWolf

Thank you for your feedback. Yes, this is something we are already aware of and is in our backlog. If you got the chance to attend our last week’s Forge Dev Den, I briefly touched on this.

The workaround you have provided may not always work. So, I got couple of workarounds which you can give it a try:

  1. Use the chat agent only from pages like issue page, which has the context variables. This is a short term fix until contextual data is available wherever needed.
  2. For example you provided for siteUrl (this is applicable to project key etc), one thing you can do is define inputs like siteUrl, projectKey etc in manifest and from Chat, you mention the inputs in the query explicitly, like “analyse issues in project TP”. This seems to work except at times, it hallucinates.

These are a few workarounds you can try in the short-term.

Thanks for raising @JulianWolf

If people could comment on this post to let us know which pages and ids are most critical for the use cases their building we’ll work that into our prioritisation.

We should be able to make some big improvements here before GA

1 Like