Problem importing SLAs field data with Jira API - c#

Good morning everyone! I am working on a c# API that interfaces with the Jira API via the Atalassian.Jira library. Specifically, to get the issues I am using IIssueService.
My problem now is that I have to import the sub-task SLA data and I have no idea how to do it. I noticed that in the imported issue object there is no data related to the SLAs.
I tried to google for answers but without success. Would anyone know how to help me?
Below is the code I use to import the issues (GetIssuesFromJqlAsync is a method of the library that I mentioned above)
{
var jql = $"issuetype = Sub-task And status = 'To Do'";
if (from.HasValue) jql = $"{jql} AND updated > '{from.Value:yyyy-MM-dd HH:mm}'";
return await jira.Issues.GetIssuesFromJqlAsync(jql);
}
Thank you for all the answers.

Related

Is there reason why I always have Tweetinvi.Exceptions.TwitterException: Forbidden error?

I am trying to make Twitter bot which job is to, when run, upload picture of Snoop Dog with quote and few hashtags. Problem is when I run my code, it throws Tweetinvi.Exceptions.TwitterException: Forbidden error.
I have tried searching for fix, but only thing I have found was just answers for meaning of error. Here is a part of code (rest are quotes, APIs and Tokens).
byte[] ImageBytes = File.ReadAllBytes("snoop.jpg");
TwitterClient UserClient = new TwitterClient(APIKey, APISecret, AccessToken, AccessSecret);
IMedia ImageIMedia = await UserClient.Upload.UploadTweetImageAsync(ImageBytes);
ITweet TweetWithImage = await UserClient.Tweets.PublishTweetAsync(new PublishTweetParameters(SnoopQuotes[RandNum.Next(10)] + "#ZemanNaUlici #SSPSNotGood #CyberMeansPrestige") { Medias = { ImageIMedia }});
Error is show here:
IMedia ImageIMedia = await UserClient.Upload.UploadTweetImageAsync(ImageBytes);
I would have loved some help, thank you.
PS: I am here for first time and english is not my primary language, so sorry if there are some mistakes.
I faced the same thing and found this video had all the answers.
https://youtu.be/aOlp3vXohB0
You need to upgrade your application in the developer portal to "Elevated", enable read/write on your posts and regenerate the API keys.

Cannot load model using WinML

As WinML is still fairly new and ever changing, I was hoping to know if anyone else has come across this error when trying to load a ONNX file made via the Custom Vision Service Export.
Type Error: Type (map(string,tensor(float))) of output arg (loss) of node (ZipMap) does not match expected type (seq(map(string,tensor(float))))
using Windows.AI.MachineLearning;
Windows RS5 1809 (build 17763.1)
UWP SDK 17763
Testing code from this link:
https://learn.microsoft.com/en-us/uwp/api/windows.ai.machinelearning
// Load and create the model
var modelFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///{_modelFileName}"));
_model = await LearningModel.LoadFromStorageFileAsync(modelFile);
Any help would be greatly appreciated.
Windows build 17763 (RS5) requires ONNX version 1.2 when Windows.AI.MachineLearning.
The Azure Custom Vision service supports this today .
Here is a post around a sample app that does this.
As a note, you need to make sure your output data type matches when you bind. In c# this looks something like this:
public sealed class ModelOutput
{
public TensorString ClassLabel = TensorString.Create(new long[] { 1, 1 });
public IList<IDictionary<string, float>> Loss = new List<IDictionary<string, float>>();
}
I received info from a Microsoft associate that stated that the windows.ai.machinelearning api only supports ONNX 2. He didn't supply a date to which we can expect the custom vision service to export version 2 files.

How to call API using C#?

I am not a c# guy. Needless to say that I don't have experience on this topic.
I bought a software and I installed it on my computer. Now I thought of using some of it's functions on my software(that I make to plan in c#). So I messaged the person who sold me the software and he send me a two page pdf file explaining what to do.
It states:
This software features a COM interface.
And it goes saying it's API contains a function "stackAPI".
and the parameters used are apiname type string, apipass type string.
Return values type long. 0 for sucess and 1 for error.
That's all it states, I tired searching google, it could not help me at all. So how do I start?
when I write the following code on c# it gives me error.
string[] apiname;
string[] apipass;
stackAPI(apiname, apipass);
I know if I was using dll I would import it as
[DllImport("example.dll"]
But no dll is provided.
Do I need to add the path to the folder where the software is installed to call the API ?
To get started:
using example.dll;
Then in your main class:
example.CustomService api = new example.CustomService();
var response = api.Dostuff();
Console.WriteLine(response);
If anyone wants to know how I did it. After a week of searching I was able to find the solution today. I wanted to call the function stackAPI(apiname, apipass);.
stackAPI(apiname, apipass) was the member of stack.callapi
So I wrote:
dynamic lifestohack = Activator.CreateInstance(Type.GetTypeFromProgID("stack.callapi"));
than just you can call the function like this.
int rv;
string[] apiname;
string[] apipass;
rv=lifestoahck.stackAPI(apiname, apipass);
Hope it may help someone.

DynamicsCrm - Retrieve Multiple is not supported

I´m developing a data-extraction tool that gets data out of DynamicsCrm.
I have a few tables tough where i get the following exception:
Additional information: The 'RetrieveMultiple' method does not support entities of type 'mailboxstatistics'.
Reading online, using fetchxml is supposed to be the solution.
For me, it looks like i´m already using fetchxml.
My code:
private static EntityCollection RequestEntityCollection(String FetchXML, Microsoft.Xrm.Client.CrmConnection c)
{
using (OrganizationService service = new OrganizationService(c))
{
EntityCollection r = service.RetrieveMultiple(new FetchExpression(FetchXML));
return r;
}
}
I´m currently using the CRM2013 SDK so EntityCollection is from the Microsoft.Xrm.Client.dll in v6.0.0.0.
Also the documentation is using the RetrieveMultiple method.
Do you have some suggestions or is this not supported and the online suggestions are misleading?
Thank you!
The message is a bit misleading.
You get that error with MailboxStatistics because the entity is for internal use only.

ExchangeServiceBinding namespace error

Summary: application will not accept the ExchangeServiceBinding command.
Details:
I am trying to loop through a very large mailbox, so I am using an index to break the inbox into 200 email chunks. The only example I could find (shown below) keeps returning
the type or namespace name “ExchangeServiceBinding” could not be found (are you missing a using directive or an assembly reference? )
Which I find strange, because I am using it using Microsoft.Exchange.WebServices;. Any ideas or help is greatly appreciated. I am running Windows 7 and Visual Studio 2010 and trying to access Exchange 2007 mailboxes.
Things I've tried:
searching Google
searching Stack Overflow
searching MSDN
slamming my head on my desk
trial and error
Code:
// Create binding variable to be used for GetItemsFromInbox().
// Set up the binding with credentials and URL.
ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Credentials = new NetworkCredential(dUser, dPassword, dDomain);
binding.Url = new Uri("https://" + ExchangeServerName + "/EWS/Exchange.asmx");
// Set up the binding for Exchange impersonation.
binding.ExchangeImpersonation = new ExchangeImpersonationType();
binding.ExchangeImpersonation.ConnectingSID = new ConnectingSIDType();
binding.ExchangeImpersonation.ConnectingSID.PrimarySmtpAddress = "mailboxnamehere”;
// Call GetItemsFromInbox()
int index = 0;
bool looping = true;
while (looping)
{
List<ItemType> items = GetItemsFromInbox(binding, index, 200, index);
if (items == null || items.count == 0)
{
looping = false;
break;
}
// Do your work here
}
Instead of the Exchange Web Services, use the Exchange Managed API.
SDK: http://msdn.microsoft.com/en-us/library/dd633710(v=exchg.80).aspx
Download: http://www.microsoft.com/download/en/details.aspx?id=13480
It's much easier to use than the WebServices.
I found my error. This methodology only works for Exchange 2010. Since I am running Exchange 2007 I will have to figure out a completely different way to make this work.
Thank you everyone for you help, I really appreciate it.
You should add a WebReference to your solution to the exchange WebService.
https://exchaneServerName/EWS/Exchange.asmx
ExchangeServiceBinding is contained into the ews.dll. According to your error, you didn't add a reference to this DLL file.
More information about Generating Exchange Web Services Proxy Classes:
So now you have a code file with the autogenerated proxies. Next, you compile your code file into an assembly for use in your Exchange Web Services projects. The C# compiler is available with the Visual Studio 2005 Command Prompt. Assuming that you named your code file EWS.cs, you can run the following command at the command prompt to compile your code into an assembly:
csc /target:library /out:EWS.dll EWS.cs
Notice that EWS.dll is the name of the compiled assembly. This is how EWS.dll is created.

Categories

Resources