mandatory fields of a transaction from JIRA rest APIs - jira

How to get the required/mandatory fields while doing a transaction in JIRA .
I have tried the below API but it is not returning any field id ..
https://ourCompany.jira.com/rest/api/2/issue/" + ticketID
+ "/transitions?expand=transitions.fields"
in the returning JSON all the value of required are coming false for all the fields(system and custom both)
even if i have some mandatory fields in the form for a transaction.

You need the metadata information of the issue. Read this: https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues
Note: you'll need the project and the issue type for the call, as the field configuration can be per project + per issuetype configured.

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.

REST API error while posting a customized Priority fields

I'm trying to post REST API of the ORDERS form.
I have added a few customized fields to the sub form PAYMENTDEF in order to post all the credit cards information.
I'm getting the error:
'An error has occurred'
any time I'm posting the customized fields, if I remove them from the request I managed to post.
{"CUSTNAME":"5","CDES":"רועי בן מנחם","CURDATE":"2018-07-18","BOOKNUM":"2164","SHIPTO2_SUBFORM":{"NAME":"רועי בן מנחם","PHONENUM":"0507573753","ADDRESS":"דן 4","STATE":"שערי תקווה","COUNTRYNAME":"Israel","ZIP":"44810","ADDRESS2":"44"},"ORDERITEMS_SUBFORM":[{"PARTNAME":"CLEAN0044","TQUANT":1,"PRICE":19.9,"REMARK1":"","ROYY_ORDISPECS_SUBFORM":[]},{"PARTNAME":"000","TQUANT":1,"PRICE":30,"REMARK1":""}],"PAYMENTDEF_SUBFORM":{"PAYMENTCODE":"3","QPRICE":53.28,"PAYACCOUNT":"1234","PAYCODE":"","VALIDMONTH":"0124","CCUID":"123456789","CONFNUM":"09090909","ROYY_NUMBEROFPAY":"","FIRSTPAY":"","ROYY_SECONDPAYMENT":""}}
And this is my header:
https://pri.officeandmore.co.il/odata/Priority/tabula.ini/tirgul2/ORDERS
Try check if these fields are visible in the REST api service:
Request the service metadata as following:
https://pri.officeandmore.co.il/odata/Priority/tabula.ini/tirgul2/$metadata
In the result check for the PAYMENTDEF subform's metadata (search for <EntityType Name="PAYMENTDEF"> and check if your customized fields appear in the property (field) list.
If they don't appear, probably these fields are set as 'hidden fields' in the 'Priority form' or that you have permission limitations.
If they do appear, the problem is probably related to incorrect values you are trying to post to these fields. Take a look in the metadata result to see the expected values format for each of these fields.

MS Graph API response not returning all the data items it supposed to

My intention is to build a Machine Learning program that will give a recommendation for archiving email item by reading all previous email history.
For that, I am trying to read all the email item from:
https://graph.microsoft.com/beta/me/messages
First I am getting the total number of email items in my account using /messages?$count=true which returns 1881 as the result.
Then I am trying to get all the 1881 item using:
https://graph.microsoft.com/beta/me/messages?$top=1881
But the problem is that returns 976 email items. Where are the rest of the email item? How I can find them?
Are you getting a #odata:nextLink property in your response?
If that's the case, you might need to send another request with a skiptoken parameter. It should contain a value from the #odata:nextLink response property.
On the "paging" documentation page - https://developer.microsoft.com/en-us/graph/docs/concepts/paging - it is specified that different APIs have different max page size. It's possible that the endpoint for fetching emails does not support a page size of 1881. In that case, you might need to access a second page of the results.
Another suggestion is to replace beta endpoint with the V1 API call because me/messages is available there also - https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_messages

Search Version jira rest api

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.

How to update "TrackingNumber" field in QuickBook invoice?

I want update "TrackingNumber" field value in Invoice related request query. So which request query i used for updating "TrackingNumber"?
I checked in "InvoiceModRq" request but there is not declare any field with the name of "TrackingNumber".
Thanks,
QuickBooks does not support updating this field programatically yet.

Resources