Search Version jira rest api - jira

I need to get all issues by version id. My query is like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+fixVersion\=10001
working fine, but I want to get issues by VERSION
Link like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+version\=10001
returned "Field 'version' does not exist or you do not have permission to view it."

The two built-in version fields in JIRA can be accessed in JQL as fixVersion and affectedVersion. I suspect that you want the latter.
If you have another custom field (which is a version-type field) that you want to query, the error message suggests that you may not be using the correct name for it. The best way to check this is to type your JQL into JIRA's Issue Navigator manually (in the advanced search) and to take advantage of the dropdown box with field name suggestions to get the correct field name.
One way to bypass the problem of determining the correct JQL field name (which sometimes requires quoting, which gets slightly more messy if you are also URL-encoding the result) is to simply refer to a field by the custom field ID instead.
You can find the CF ID of a field by going to Admin->Issues->Custom Fields, finding the appropriate custom field, mousing over the "Configure" link, and then looking at the URL query parameter for customFieldId, and then use the syntax cf[xxxxxx] in your JQL instead of the field name, where xxxxxx is the custom field number.

Related

jira createmeta not showing all customfields

If I navigate to /rest/api/2/issue/createmeta/PROJ/issuetype/N (in this case, I'm getting Task), the list of fields returned is incomplete. There are a number of customfields that are in use (I can see them both in the tickets themselves, and also in /plugins/servlet/project-config/PROJ/fields ) that are in the createmeta data.
I'm really trying to do this in python jira, where I'm using "expand='projects.issuetypes.fields'" in the createmeta() call, but I figured I'd double-check the results in the rest API directly, and I'm getting the same results there, too.
This is happening in jira 8.20.7.
Essentially, what I'm trying to do, is to programatically get a name/id mapping of all fields in the ticket type. I'm having far more difficulty doing that than I thought there would be. I would do it based on /rest/api/2/field but the jira admins have allowed some duplicated names...
EDIT: I realized that it might be worth noting that some of the fields I'm looking for are coming from a ServiceDesk form, although, as far as I can tell, there's no way to determine that, since one of the missing fields contains the name of the form.
Why are you using createmeta endpoint?
Instead of that, in order to get all of the customfields and their values; just note their id and get the values from /rest/api/2/issue/{issueKey} endpoint.
When you send a GET request to /rest/api/2/issue/{issueKey} endpoint, you will get a JSON object which contains "fields" object in it.
And using the "fields" you can determine all of the values that include system fields (description, assignee, etc.) and custom fields (like customfield_<customfieldid>).
And for a general approach, you may want to look at the field types in that response.

How can i make a "parameterized" JQL

Is there any possibility to create a JQL query that can be parameterized with a specific value that can be selected by a user for a dashboard? For example, I wanna show all issues that are linked to a certain issue via a specific link type.
The query I use for links looks like this:
project = Bar and issueFunction in linkedIssuesOfRecursive("project = Foo and key = Foo-123", "relates to")
As you can see, the query itself is not the problem, its rather simple, but the key is hardcoded. Is there any way of creating a dashboard / rich filter, where the user can simply enter a key and the query is executed with that key?

ServiceNow Rest API (using PowerBI)

I'm on a project in which I need to get data from a ServiceNow instance and treat all data with PowerBI. I'm able to retrieve a big amount of data (Snow collect a lot of data), but I still need a way to filter data correctly. I'm calling to this URL:
Besides, I want also to apply a filter to retrieve just some specific registries from the table Requested Items. For that, I use the sysparm_query parameter to filter the field "cmdb_ci" and more specifically it's "name", something like:
&sysparm_query=cmdb_ci=What I need to Filter
Apart from this, I have also tried:
&sysparm_query=cmdb_ci.value=What I need to Filter
&sysparm_query=cmdb_ci.display_value=What I need to Filter
&sysparm_query=cmdb_ci.sys_id=What I need to Filter
&sysparm_query=cmdb_ci.name=What I need to Filter
But still not found the solution... as all these does not respond the solution needed.
Does someone know how I can manage this?
Thanks!!
JLG
There are two "Configuration item" fields in sc_req_item: cmdb_ci and configuration_item. Make sure that you are using the correct one. Either cmdb_ci.name=value or configuration_item.name=value should work, depending on which of the two fields you are using. cmdb_ci.value and cmdb_ci.display_value will not work as there are no fields on the record with these names. cmdb_ci.sys_id should work if you are supplying a sys_id (although it is redundant to type .sys_id for a reference field).
You should first verify your query through the ServiceNow UI before attempting to use it in an API call.
Type sc_req_item.list in the Filter navigator
On the filter list select "Show related fields"
Get your filter to work correctly
Right-click on the filter and select "Copy query"
The next step is to test it using the REST API Explorer.
Final step is to configure your client tool (PowerBI).

Drupal 7 create url using characters from field

I am having a drupal 7 node about software releases. The title field of the release is
"Release v6-05-01"
I need to construct a URL based on this title that goes like this http://example.com/html605/Class.html
I know hot to construct the URL but the "605" bit is tricky because I have no token for it.
I thought that maybe I could take the characters from the title one by one? Is this possible in Drupal 7?
One solution could be to add a new field (eg "version number", text field) to your content type to hold the "605" string, and then use this token (typically : [node:field_version_number]) to construct your URL. But you'll have one more field to manage when creating new nodes, and maybe a lot of work to process existing nodes.
Depending on how this number is constructed from the node title, you could try using Computed Field or Dynamic Field, and create a PHP computed field. In PHP you could build the version number with some substr logic based on the node title (its value is available in the PHP snippet). This way you don't have to fill the new field for each new node and existing nodes should be automatically updated.
Good luck

Access 2010 form not displaying query

I'm sure this is an easy fix but I can't seem to find it. I just have a form, that will be a subform of another, that needs to display the results of a query.
The query is simple enough, just displays all fields of records that fall between specified dates. The query works great, but when I attach it to the form as its record source it doesn't display the data. I can see the correct amount of record selectors so I know its understanding the query but its as if all fields are hidden!
I have also tried building a query to the forms record source that was simply Select query.* From query. Oddly I have had this working before but I had to specify every field. What I mean is:
Select title From query
Select type From query
Select date From query
...
And so on for all the fields but this seems foolish, can anyone think of what I may be doing wrong?
Thanks in advance!
Edit, forgot to mention I also tried the foolish solution that I mentioned above and it didn't work so its definitely some issue that I'm not seeing, some property that's probably not appropriately set
#sshekhar well its not really code at the moment I'm using Access 2010. I have a form that needs to display a subform that executes this query of displaying records that have a data field that fall between dates specified by the user. The query works and displays the correct records, but the form that it is attached to only shows the record selectors and all the fields appear to be "hidden." I thought it may be one of the form's properties set incorrectly but I checked on the test form from another database that I used and each have what appears to be identical settings. So I'm at a loss!
So it turns out even though I using a query that holds all the fields it will not display the content unless you go to the Add Existing Fields and add all the the fields you want to see. This seems really silly especially when the results in the query but at least its working now.
I had this problem and discovered that having the property DataEntry set to YES will only display new records. From Microsoft Help:
You can use the DataEntry property to specify whether a bound form
opens to allow data entry only. The Data Entry property doesn't
determine whether records can be added; it only determines whether
existing records are displayed. Read/write Boolean.

Resources