How to add default URL in Sections Schema - shopify

I have been trying to create a schema for a dynamic section, and use some predefined default URL for some pages but liquid cannot accept it. This is the schema code:
{% schema %}
{
"name": "My New Section",
"class": "homepage-section",
"tag": "section",
"settings": [
{
"type": "text",
"id": "section-heading",
"label": "Section Heading",
"default": "Default Heading",
"info": "Meaningful copy in 25 characters or less."
},
{
"type": "url",
"id": "link-1",
"label": "Link URL 1",
"default": "/collections/mycollection"
}
],
"presets": [
{
"name": "My New Section",
"category": "My Sections"
}
]
}
{% endschema %}
So, for the "type": "url" I try to define the default collection "default": "collections/mycollection" and this is the error message when I try to save the file:
This file contains the following errors: Error: Invalid schema:
setting with id="link" default must be a string or datasource access
path
I tried some different options without success:
"default": "https://testing.myshopify.com/"
"default": "https://testing.myshopify.com/"
"default": "collections/mycollection"
"default": "collections/mycollection"
Please, let me know if there is anyway to handle it.

You need to read the documentation regarding the special input type provided by Shopify called URL
According to the documentation, you can only set these 2 URLs by default:
/collections
/collections/all
This is because these are two URLs that are present after the store creates automatically, one is set for all collections list pages and once for all products pages. so Shopify knows these two's have already existed.
So these are two default values that you accept into URL fields into the Shopify schema.

Related

jira res-api create issue with bullets list in description

Hi i want to create a jira issue with bullet list and other formating from rest-api
Right know i am testing this code, but it returns
{
"errorMessages": [],
"errors": {
"description": "Operation value must be a string"
}
}
Body looks like this
{
"fields": {
"project": {
"key": "DWH"
},
"issuetype": {
"name": "Story"
},
"summary": "auto created datatask",
"description": "description": ["Pro:<fil pro and activity number provided>.",
"Tablename:<fill table name>.",
"Table view:<fill table view name>.",
"endpoint:<fill knudepunkt>.",
"Task to do.",
"*Copy attached document to metadata/new folder.",
"* Run job to create the table.",
"* Test the data in Production when ready.",
"* Create extra userstory"],
"assignee": {
"key": "bdmdwhdata",
"name": "bdmdwhdata",
"emailAddress": "dwhdata#bankdata.dk"
},
"labels": ["DATA"]
}
}
Is it possible to create multiline decription from REST-API in jira issues
I i jost write a single line in description it works fine.
For adding new lines, try using \n in the description. For more information, kindly check this documentation.

How to remove blocks section from Shopify schema

How could I remove blocks section from shopify schema code? I simply tried to delete it but was not able to save due to a strange error. Please see the code below:
{% schema %}
{
"name": "Featured Collection",
"settings": [
{
"type": "collection",
"id": "featured_collection",
"label": "Collection"
},
{
"type": "text",
"id": "collection_button_label",
"label": "Button Label",
"default": "Learn More"
}
],
"blocks": [
{
"type": "section",
"name": "Section",
"settings": [
]
}
],
"presets": [
{
"name": "Featured Collection",
"category": "Product"
}
]
}
{% endschema %}
I can save the above code without any error. But When I remove the code section of "blocks", I get the following error:
Error: New schema is incompatible with the current setting value. Invalid type value for block '1577470637989'. Type must be defined in schema.New schema is incompatible with the current setting value. Invalid type value for block '1577470668608'. Type must be defined in schema
The error is kind of self explanatory. The error message
Error: New schema is incompatible with the current setting value.
Invalid type value for block '1577470637989'. Type must be defined in
schema.New schema is incompatible with the current setting value.
Invalid type value for block '1577470668608'. Type must be defined in
schema
It states that new schema that you are trying to save is not compatible with existing data you have. Shopify does not know what to do with existing blocks of those types which you want to remove.
So just remove those blocks from Shopify Customizer first and then edit the schema.

Ruckus SmartZone API

I am having issues when trying to create a Zone using the API.
I can create the zone with the basic info, but as soon as I want to add another property (specifically "location") I get an error.
This is my dataset I use for the POST
def id_prov ={
"domainId": "$DomainId",
"name": "$ZoneName",
"login": {
"apLoginName": "xxxxx",
"apLoginPassword": "xxxxx"
},
"description": "$jira_summ",
"version": "3.5.1.0.1010",
"countryCode": "ZA"
"location": "$CalledStationName_val",
}
The API creates everything until I either include the "location" property in the original POST or if I try a PUT or PATCH atferwards.
Result value:
{"message":["object instance has properties which are not allowed by the schema: [\"location\"]"],"errorCode":101,"errorType":"Bad HTTP request"}
Anyone come across this or have any ideas on how to get this working?
Thanks
A comma is required after "countryCode": "ZA". The post payload should look like this:
def id_prov ={
"domainId": "$DomainId",
"name": "$ZoneName",
"login": {
"apLoginName": "xxxxx",
"apLoginPassword": "xxxxx"
},
"description": "$jira_summ",
"version": "3.5.1.0.1010",
"countryCode": "ZA",
"location": "$CalledStationName_val",
}

JIRA Rest API select minimal resource

I am using JIRA REST API for querying issues with below jql
jql=project =SLUB and "Agile Team" in ("Iris (B2C)")&fieldsByKeys=true&fields=status&maxResults=1
I am getting api response as
{
"expand": "names,schema",
"startAt": 0,
"maxResults": 1,
"total": 1172,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "35988",
"self": "https://xyz.atlassian.net/rest/api/2/issue/35988",
"key": "SLUB-7071",
"fields": {
"status": {
"self": "https://xyz.atlassian.net/rest/api/2/status/10200",
"description": "",
"iconUrl": "https://xyz.atlassian.net/",
"name": "To Do",
"id": "10200",
"statusCategory": {
"self": "https://xyz.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
}
}
}
]
}
How can I only fetch status name instead of complete status resource. Please suggest.
https://docs.atlassian.com/jira/REST/latest/#d2e3181
Check This .
The fields param (which can be specified multiple times) gives a comma-separated list of fields to include in the response. This can be used to retrieve a subset of fields. A particular field can be excluded by prefixing it with a minus.
By default, only navigable (*navigable) fields are returned in this search resource. Note: the default is different in the get-issue resource -- the default there all fields (*all).
*all - include all fields
*navigable - include just navigable fields summary,comment - include just the summary and comments
-description - include navigable fields except the description (the default is *navigable for search)
*all,-comment - include everything except comments
Copied From Here.

Error loading file stored in Google Cloud Storage to Big Query

I have been trying to create a job to load a compressed json file from Google Cloud Storage to a Google BigQuery table. I have read/write access in both Google Cloud Storage and Google BigQuery. Also, the uploaded file belongs in the same project as the BigQuery one.
The problem happens when I access to the resource behind this url https://www.googleapis.com/upload/bigquery/v2/projects/NUMERIC_ID/jobs by means of a POST request. The content of the request to the abovementioned resource can be found as follows:
{
"kind" : "bigquery#job",
"projectId" : NUMERIC_ID,
"configuration": {
"load": {
"sourceUris": ["gs://bucket_name/document.json.gz"],
"schema": {
"fields": [
{
"name": "id",
"type": "INTEGER"
},
{
"name": "date",
"type": "TIMESTAMP"
},
{
"name": "user_agent",
"type": "STRING"
},
{
"name": "queried_key",
"type": "STRING"
},
{
"name": "user_country",
"type": "STRING"
},
{
"name": "duration",
"type": "INTEGER"
},
{
"name": "target",
"type": "STRING"
}
]
},
"destinationTable": {
"datasetId": "DATASET_NAME",
"projectId": NUMERIC_ID,
"tableId": "TABLE_ID"
}
}
}
}
However, the error doesn't make any sense and can also be found below:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Job configuration must contain exactly one job-specific configuration object (e.g., query, load, extract, spreadsheetExtract), but there were 0: "
}
],
"code": 400,
"message": "Job configuration must contain exactly one job-specific configuration object (e.g., query, load, extract, spreadsheetExtract), but there were 0: "
}
}
I know the problem doesn't lie either in the project id or in the access token placed in the authentication header, because I have successfully created an empty table before. Also I specify the content-type header to be application/json which I don't think is the issue here, because the body content should be json encoded.
Thanks in advance
Your HTTP request is malformed -- BigQuery doesn't recognize this as a load job at all.
You need to look into the POST request, and check the body you send.
You need to ensure that all the above (which seams correct) is the body of the POST call. The above Json should be on a single line, and if you manually creating the multipart message, make sure there is an extra newline between the headers and body of each MIME type.
If you are using some sort of library, make sure the body is not expected in some other form, like resource, content, or body. I've seen libraries that use these differently.
Try out the BigQuery API explorer: https://developers.google.com/bigquery/docs/reference/v2/jobs/insert and ensure your request body matches the one made by the API.