I am working with dialogs in Slack and select lists. I am trying to set the selected_options default value but I am still getting the placeholder.
{
"label": "Are these notes private?",
"type": "select",
"name": "private_notes",
"optional": "true",
"hint": "Public notes are automatically published to #heartbeat",
"options": [{'label': 'yes', 'value': 'yes'}, {'label': 'no', 'value': 'no'}],
'selected_options': [{'label': 'no', 'value': 'no'}],
}
result:
The selected_options property only works for dynamic select menus, not for static ones. And btw. there no point in setting multiple defaults for a select menu. It can only have one default.
To set a default value for a static select menu use the property value.
Example for setting yes as default:
{
"label": "Are these notes private?",
"type": "select",
"value": "yes",
"name": "private_notes",
"optional": "true",
"hint": "Public notes are automatically published to #heartbeat",
"options": [{'label': 'yes', 'value': 'yes'}, {'label': 'no', 'value': 'no'}]
}
Also see here for reference in the official documentation.
Related
I am new to Jira and I created jira custom app using Atlassian connect express.
I used api from https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/
Atlassian components from https://atlassian.design/components/
In my app there is two filter dropdown is present, one is for columns and another is status of issues in jira.
For saving the filter view, I followed the below steps:-
Create filter on save button. (/rest/api/3/filter.)
Search filter for get all created filter. (/rest/api/3/filter/search).
But the problem occur after create filter that only the status filter is saved properly, but columns are not saved in it.
I tried to set columns after the filter is created but it not work for me.
Used set columns api. (PUT /rest/api/3/filter/{id}/columns)
Also try to get columns. (GET /rest/api/3/filter/{id}/columns).
Here I attached my github link please refer it.
https://github.com/kuldip-estatic/jira-plugin-project
For starting the app you can read readme.md file after clone the project.
When I save the view, I also pass the selected columns but, I cannot retrieve from the GET API.
Please help me in this if any one has idea about this.
Thanks.
yes, you can do that:
you make a GET to https:///rest/api/latest/filter/<filterId>/columns
and the jira should response with something like:
[
{
"label": "Issue Type",
"value": "issuetype"
},
{
"label": "Priority",
"value": "priority"
},
{
"label": "Created",
"value": "created"
},
{
"label": "Status",
"value": "status"
},
{
"label": "Key",
"value": "issuekey"
},
{
"label": "Summary",
"value": "summary"
},
{
"label": "Creator",
"value": "creator"
},
{
"label": "Assignee",
"value": "assignee"
},
{
"label": "Story Points",
"value": "customfield_124"
}
]
I'm experimenting ways to allow users to interact with my app through Slack.
So far, I was able to create a Home App, so that when the user clicks on the app it displays a neat page, with formatted text, images, and some action buttons (built with Block Kit).
What I am not being able to do is handling the user interactions, specifically when the user clicks one of the buttons. I got Slack to invoke my app's API, but the message I receive is absolutely nothing to do with the documentation.
On Slack, I set up Interactivity & Shortcuts, sending all requests to https://slack-interaction-sample.xpto.com/slack/v1/actions.
I then send a message to Slack, using Block Kit, containing a simple button:
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": `*JT*\nBackend Developer # ${ currentTime }`
},
"accessory": {
"type": "image",
"image_url": "https://i.pinimg.com/474x/fb/b5/b6/fbb5b6798f31538f2497e7ceb2b52674.jpg",
"alt_text": "JT"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Do Stuff",
"emoji": true
},
"style": "primary",
"value": "doStuff"
}
]
}
]
This message is correctly displayed on Slack. When I click the button, Slacks sends a request to the configured URL and, on my nodejs instance, the following code is executed:
app.post("/slack/v1/actions", function(req, res) {
console.log("**********************************************************");
console.log("/slack/v1/actions");
console.log("**********************************************************");
console.log("Request: %s",req);
res.status(200);
res.json({});
console.log("**********************************************************");
});
According to Slack's documentation (https://api.slack.com/interactivity/handling), I should be getting a payload parameter with something like this:
[
{
"action_id": "action-id-0",
"block_id": "/RXP",
"text": {
"type": "plain_text",
"text": "Ask",
"emoji": true
},
"value": "approve",
"style": "primary",
"type": "button",
"action_ts": "1588254893.249857"
}
]
Instead, what I get is this:
IncomingMessage {
_readableState: [ReadableState],
readable: true,
_events: [Object: null prototype],
_eventsCount: 1,
_maxListeners: undefined,
socket: [Socket],
connection: [Socket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: false,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '/slack/v1/actions',
method: 'POST',
statusCode: null,
statusMessage: null,
client: [Socket],
_consuming: false,
_dumped: false,
next: [Function: next],
baseUrl: '',
originalUrl: '/slack/v1/actions',
_parsedUrl: [Url],
params: {},
query: {},
res: [ServerResponse],
body: {},
route: [Route],
[Symbol(kCapture)]: false
}:
´´´
Any ideas on what I am doing wrong?
Thank you!
Creating a column chart with some dynamically populated drilldowns. For the surface level, I'm returning the top ten results of my search, some of which share a common name.
Names display as categories just fine for both the surface and drill downs when specifying xAxis type: 'category'. However, since the surface level can have duplicate names, it's stacking them be default. Is there a setting to prevent this?
Thanks!
Perhaps the solution to this issue will be to add the same category data in two separate series. I guess you add it as one series? Check demo I posted you below.
Two series:
"series": [{
"name": "Browsers",
"colorByPoint": true,
"data": [{
"name": "Chrome",
"y": 62.74,
"drilldown": "Chrome2"
},
{
"name": "Internet Explorer",
"y": 7.23,
"drilldown": "Internet Explorer"
}
]
}, {
"data": [{
"name": "Chrome",
"y": 10.57,
"drilldown": "Chrome1"
}]
}]
One series:
"series": [{
"name": "Browsers",
"colorByPoint": true,
"data": [{
"name": "Chrome",
"y": 62.74,
"drilldown": "Chrome2"
},
{
"name": "Internet Explorer",
"y": 7.23,
"drilldown": "Internet Explorer"
},
{
"name": "Chrome",
"y": 10.57,
"drilldown": "Chrome1"
}
]
}]
Demo:
two series - https://jsfiddle.net/wchmiel/h04egdu7/3/
one series - https://jsfiddle.net/wchmiel/pnj3etd4/
I know that it is possible to include a hyperlink in an Apple News Format article using markdown by doing the following:
{
"version": "1.0",
"identifier": "sketchyTech_Demo",
"title": "My First Article",
"language": "en",
"layout": {},
"components": [
{
"role": "title",
"text": "My First Article",
"textStyle": "titleStyle"
},
{
"role": "body",
"format": "markdown",
"text": "Here's a [hyperlink](http://sketchytech.blogspot.co.uk).",
"textStyle": "bodyStyle"
}
],
"componentTextStyles": {
"titleStyle": {
"textAlignment": "center",
"fontName": "HelveticaNeue-Bold",
"fontSize": 64,
"lineHeight": 74,
"textColor": "#000"
},
"bodyStyle": {
"textAlignment": "left",
"fontName": "Georgia",
"fontSize": 18,
"lineHeight": 26,
"textColor": "#000"
}
}
}
but in Apple News Format there is also a Link Addition type, which I presume should work in a similar way to inline text styles, which are placed inside a component like this:
{
"role": "title",
"text": "My First Article",
"textStyle": "titleStyle",
"inlineTextStyles": [{
"rangeStart": 3,
"rangeLength": 5,
"textStyle": {
"textColor": "#FF00007F"
}
}
}
Apple provides sample code:
{
"type": "link",
"URL": "http://www.apple.com",
"rangeStart": 0,
"rangeLength": 20
}
But it doesn't give any instructions on where it should be placed like the other elements do. It is also rather mysterious that it has a "type" key, which is unlike other elements. Not only this but in the type description it is described as a LinkAddition in all uppercase. I have tried various combinations, the most obvious of which I would guess to be
"linkAdditions": [{
"type": "link",
"URL": "http://www.apple.com",
"rangeStart": 0,
"rangeLength": 20
}]
added to a component in the same way as inlineTextStyles (because a block of text could have multiple links, just as it can have multiple styles) but I can't get this or any variants that I've tried to work. Is it perhaps that News Preview isn't yet capable of rendering this?
Add it under the "additions" property instead of under "linkAdditions" inside of the component as you expected.
For example, this should work:
...
"role": "body",
"text": "Article text goes here and here",
"additions": [{
"type": "link",
"URL": "http://www.apple.com",
"rangeStart": 0,
"rangeLength": 20
}],
...
Note: if the format is markdown it will ignore the additions property.
OK, so I downloaded this plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin
And select Multi-Level Single Select as the type of parameters.
The problem is that when I have multiple parameters selected and I want to use these parameters in shell in a build, I can only select the LAST parameter
So if I do $PARAM_NAME it only outputs the last parameters, but I want all the parameters that I selected, not just the last one.
Here is a picture for demonstration
You aren't building the parameter based on the selections, you are navigating to the value that you want. I.E. Country --->State ---->City
You aren't building a CountryStateCity variable, you are stating that the City variable is the value you select.
I could get the nearest to this by using Extended Choice Parameter > JSON Parameter Type > JSON Parameter Config Groovy Script.
import org.boon.Boon;
def jsonEditorOptions = Boon.fromJson(/{
disable_edit_json: true,
disable_properties: true,
no_additional_properties: true,
disable_collapse: true,
disable_array_add: false,
disable_array_delete: false,
disable_array_reorder: false,
theme: "bootstrap3",
iconlib: "fontawesome5",
schema: {
"type": "object",
"title": "",
"required": [
"Locations"
],
"properties": {
"Locations": {
"type": "array",
"format": "table",
"title": "",
"uniqueItems": true,
"items": {
"type": "object",
"title": "Location",
"properties": {
"Country": {
"type": "string",
"propertyOrder" : 1,
"enum": [
"USA",
"Germany",
"India"
]
},
"City": {
"type": "string",
"propertyOrder" : 2,
"enum": [
"New York",
"Frankfurt",
"Mumbai"
]
},
"Neighborhood": {
"type": "string",
"propertyOrder" : 3
}
}
},
"default": [{
"Country": "USA",
"City": "New York",
"Neighborhood": "Times Square"
}]
}
}
}
/);
You can visit the plugin page and json-editor.github.io to create and validate your
JSON schemas as seen above.
This is how it appears in Jenkins:
Note that however, it still does not provide a context sensitive
second column based on what is selected in the first column. The
second column rather behaves exactly like the first column where you
select from a pre-defined list without any filters.
On printing the variable Location, it returns this JSON:
{"Locations":[{"City":"New York","Country":"USA","Neighborhood":"Times Square"},{"City":"Frankfurt","Country":"Germany","Neighborhood":"Bornheim"},{"City":"Mumbai","Country":"India","Neighborhood":"Vile Parle"}]}
I met the same problem, so I added a 'row number' column to the parameters file:
Country City Row
United States San Francisco 1
United States Chicago 2
Mexico Mexico City 3
Mexico Cancun 4
This way, the plugin returns the row number and I can address that row from the parameters file.