How to get JQL search results data in HTML format

Hi,

I need to get field values as HTML data,
I tried with following REST api

/rest/api/3/search?jql=project=TEST&expand=renderedFields

but renderedFields section returning with Null for most of the fields :frowning:

is there any other way to get this data? I am trying to build dynamic table with JQL data.

Thanks,
Prasad

Hi @prasad.rambanam,

From https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-filter-search-get the available expand fields are:

  • description Returns the description of the filter.
  • favourite Returns an indicator of whether the user has set the filter as a favorite.
  • favouritedCount Returns a count of how many users have set this filter as a favorite.
  • jql Returns the JQL query that the filter uses.
  • owner Returns the owner of the filter.
  • searchUrl Returns a URL to perform the filter’s JQL query.
  • sharePermissions Returns the share permissions defined for the filter.
  • subscriptions Returns the users that are subscribed to the filter.
  • viewUrl Returns a URL to view the filter.

One thing to note here is that the expand field is not used to change the view results but rather to ask the endpoint which fields you want returned. I don’t think we have something like this in cloud (please correct me if I’m wrong).

Cheers,
Anne

@acalantog filters will not work for us since need to get issues data with JQL and i am referring https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-search-get
with above REST and renderedFields it should give html data but it is returning null for most of the fields

expand

string

Use expand to include additional information about issues in the response. This parameter accepts multiple values separated by a comma:

  • renderedFields Returns field values rendered in HTML format.
  • names Returns the display name of each field.
  • schema Returns the schema describing a field type.
  • transitions Returns all possible transitions for the issue.
  • operations Returns all possible operations for the issue.
  • editmeta Returns information about how each field can be edited.
  • changelog Returns a list of recent updates to an issue, sorted by date, starting from the most recent.
  • versionedRepresentations Instead of fields , returns versionedRepresentations a JSON array containing each version of a field’s value, with the highest numbered item representing the most recent version.

Thanks,

Hi @prasad.rambanam,

Oh! Sorry I missed that. There’s definitely renderedFields. Thanks for pointing that out! Let me give a look.

Cheers,
Anne

@acalantog did you get any chance to look in to the search rest ?

Any help on this? or alternative way to get the data in HTML format?

If a field isn’t returned in the renderedFields section, there isn’t any other way for Jira to render it in HTML. You would need to render them yourself in your application. You can check the type of each field using the /rest/api/2/field API, and then render each value differently depending on which type it is.

@kkercz thank you for the response!

rendering my self will take more time and lot of coding :frowning:

Actually, I am able to develop my own rest call on server version but on cloud we don’t have much control on jira api and need to depend on JIRA REST api’s!

I see that it is a bug : [JRASERVER-65922] renderedFields include Fields with Null values - Create and track feature requests for Atlassian products.

That bug seems to be about either including fields that Jira doesn’t know how to render and returning null for them, or not including them at all in the response.

Which fields are you interested in? In most cases they are just simple values, and I would expect rich-text fields like comments to already return rendered versions.

actually, i am looking for all the fields and specially for status, issuetype,status and similar fields